summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorroot <siehputz@gmail.com>2021-01-28 14:42:39 -0600
committerroot <siehputz@gmail.com>2021-01-28 14:42:39 -0600
commit67f128c0cf95910c03fb1e0e3d8582efc8c03d09 (patch)
tree72065625ecd978cbb17c3b1f7a1574bf23c9ff4e /ports
parentccdc97d23e93ed827a66491ea2908fcab889d3e4 (diff)
Fixing microcontroller.cpu on muti-core cpus and adding microcontroller.cpus
Diffstat (limited to 'ports')
-rw-r--r--ports/raspberrypi/common-hal/microcontroller/__init__.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ports/raspberrypi/common-hal/microcontroller/__init__.c b/ports/raspberrypi/common-hal/microcontroller/__init__.c
index e454ffa1b..acb4b971c 100644
--- a/ports/raspberrypi/common-hal/microcontroller/__init__.c
+++ b/ports/raspberrypi/common-hal/microcontroller/__init__.c
@@ -80,6 +80,7 @@ void common_hal_mcu_reset(void) {
// The singleton microcontroller.Processor object, bound to microcontroller.cpu
// It currently only has properties, and no state.
+#if CIRCUITPY_PROCESSOR_COUNT > 1
static const mcu_processor_obj_t processor0 = {
.base = {
.type = &mcu_processor_type,
@@ -92,7 +93,7 @@ static const mcu_processor_obj_t processor1 = {
},
};
-const mp_rom_obj_tuple_t common_hal_mcu_processor_obj = {
+const mp_rom_obj_tuple_t common_hal_multi_processor_obj = {
{&mp_type_tuple},
CIRCUITPY_PROCESSOR_COUNT,
{
@@ -100,6 +101,13 @@ const mp_rom_obj_tuple_t common_hal_mcu_processor_obj = {
MP_ROM_PTR(&processor1)
}
};
+#endif
+
+const mcu_processor_obj_t common_hal_mcu_processor_obj = {
+ .base = {
+ .type = &mcu_processor_type,
+ },
+};
#if CIRCUITPY_NVM && CIRCUITPY_INTERNAL_NVM_SIZE > 0
// The singleton nvm.ByteArray object.