summaryrefslogtreecommitdiff
path: root/shared-bindings/microcontroller
diff options
context:
space:
mode:
Diffstat (limited to 'shared-bindings/microcontroller')
-rw-r--r--shared-bindings/microcontroller/Pin.c2
-rw-r--r--shared-bindings/microcontroller/Processor.c8
-rw-r--r--shared-bindings/microcontroller/Processor.h2
-rw-r--r--shared-bindings/microcontroller/RunMode.c8
-rw-r--r--shared-bindings/microcontroller/RunMode.h2
-rw-r--r--shared-bindings/microcontroller/__init__.c10
6 files changed, 16 insertions, 16 deletions
diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c
index d5b971ae5..931c0b4c4 100644
--- a/shared-bindings/microcontroller/Pin.c
+++ b/shared-bindings/microcontroller/Pin.c
@@ -36,7 +36,7 @@
//| class Pin:
//| """Identifies an IO pin on the microcontroller."""
//|
-//| def __init__(self, ):
+//| def __init__(self) -> None:
//| """Identifies an IO pin on the microcontroller. They are fixed by the
//| hardware so they cannot be constructed on demand. Instead, use
//| `board` or `microcontroller.pin` to reference the desired pin."""
diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c
index c4b249124..d9f780f84 100644
--- a/shared-bindings/microcontroller/Processor.c
+++ b/shared-bindings/microcontroller/Processor.c
@@ -44,7 +44,7 @@
//| print(microcontroller.cpu.temperature)"""
//|
-//| def __init__(self, ):
+//| def __init__(self) -> None:
//| """You cannot create an instance of `microcontroller.Processor`.
//| Use `microcontroller.cpu` to access the sole instance available."""
//| ...
@@ -67,7 +67,7 @@ const mp_obj_property_t mcu_processor_frequency_obj = {
},
};
-//| temperature: Any = ...
+//| temperature: Optional[float] = ...
//| """The on-chip temperature, in Celsius, as a float. (read-only)
//|
//| Is `None` if the temperature is not available."""
@@ -87,7 +87,7 @@ const mp_obj_property_t mcu_processor_temperature_obj = {
},
};
-//| uid: Any = ...
+//| uid: bytearray = ...
//| """The unique id (aka serial number) of the chip as a `bytearray`. (read-only)"""
//|
STATIC mp_obj_t mcu_processor_get_uid(mp_obj_t self) {
@@ -106,7 +106,7 @@ const mp_obj_property_t mcu_processor_uid_obj = {
},
};
-//| voltage: Any = ...
+//| voltage: Optional[float] = ...
//| """The input voltage to the microcontroller, as a float. (read-only)
//|
//| Is `None` if the voltage is not available."""
diff --git a/shared-bindings/microcontroller/Processor.h b/shared-bindings/microcontroller/Processor.h
index 1088112f4..0f520f940 100644
--- a/shared-bindings/microcontroller/Processor.h
+++ b/shared-bindings/microcontroller/Processor.h
@@ -31,7 +31,7 @@
#include "common-hal/microcontroller/Processor.h"
-const mp_obj_type_t mcu_processor_type;
+extern const mp_obj_type_t mcu_processor_type;
uint32_t common_hal_mcu_processor_get_frequency(void);
float common_hal_mcu_processor_get_temperature(void);
diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c
index 6db315d8d..38bbb612b 100644
--- a/shared-bindings/microcontroller/RunMode.c
+++ b/shared-bindings/microcontroller/RunMode.c
@@ -29,22 +29,22 @@
//| class RunMode:
//| """run state of the microcontroller"""
//|
-//| def __init__(self, ):
+//| def __init__(self) -> None:
//| """Enum-like class to define the run mode of the microcontroller and
//| CircuitPython."""
//|
-//| NORMAL: Any = ...
+//| NORMAL: RunMode = ...
//| """Run CircuitPython as normal.
//|
//| :type microcontroller.RunMode:"""
//|
-//| SAFE_MODE: Any = ...
+//| SAFE_MODE: RunMode = ...
//| """Run CircuitPython in safe mode. User code will not be run and the
//| file system will be writeable over USB.
//|
//| :type microcontroller.RunMode:"""
//|
-//| BOOTLOADER: Any = ...
+//| BOOTLOADER: RunMode = ...
//| """Run the bootloader.
//|
//| :type microcontroller.RunMode:"""
diff --git a/shared-bindings/microcontroller/RunMode.h b/shared-bindings/microcontroller/RunMode.h
index 5e8b6e646..ce90ab93a 100644
--- a/shared-bindings/microcontroller/RunMode.h
+++ b/shared-bindings/microcontroller/RunMode.h
@@ -35,7 +35,7 @@ typedef enum {
RUNMODE_BOOTLOADER
} mcu_runmode_t;
-const mp_obj_type_t mcu_runmode_type;
+extern const mp_obj_type_t mcu_runmode_type;
typedef struct {
mp_obj_base_t base;
diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c
index 88fe9c224..6d556cdd7 100644
--- a/shared-bindings/microcontroller/__init__.c
+++ b/shared-bindings/microcontroller/__init__.c
@@ -54,7 +54,7 @@
//| This object is the sole instance of `microcontroller.Processor`."""
//|
-//| def delay_us(delay: Any) -> Any:
+//| def delay_us(delay: int) -> None:
//| """Dedicated delay method used for very short delays. **Do not** do long delays
//| because this stops all other functions from completing. Think of this as an empty
//| ``while`` loop that runs for the specified ``(delay)`` time. If you have other
@@ -72,7 +72,7 @@ STATIC mp_obj_t mcu_delay_us(mp_obj_t delay_obj) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mcu_delay_us_obj, mcu_delay_us);
-//| def disable_interrupts() -> Any:
+//| def disable_interrupts() -> None:
//| """Disable all interrupts. Be very careful, this can stall everything."""
//| ...
//|
@@ -82,7 +82,7 @@ STATIC mp_obj_t mcu_disable_interrupts(void) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_disable_interrupts_obj, mcu_disable_interrupts);
-//| def enable_interrupts() -> Any:
+//| def enable_interrupts() -> None:
//| """Enable the interrupts that were enabled at the last disable."""
//| ...
//|
@@ -92,7 +92,7 @@ STATIC mp_obj_t mcu_enable_interrupts(void) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_enable_interrupts_obj, mcu_enable_interrupts);
-//| def on_next_reset(run_mode: microcontroller.RunMode) -> Any:
+//| def on_next_reset(run_mode: microcontroller.RunMode) -> None:
//| """Configure the run mode used the next time the microcontroller is reset but
//| not powered down.
//|
@@ -117,7 +117,7 @@ STATIC mp_obj_t mcu_on_next_reset(mp_obj_t run_mode_obj) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mcu_on_next_reset_obj, mcu_on_next_reset);
-//| def reset() -> Any:
+//| def reset() -> None:
//| """Reset the microcontroller. After reset, the microcontroller will enter the
//| run mode last set by `on_next_reset`.
//|