summaryrefslogtreecommitdiff
path: root/atmel-samd
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2016-12-01 13:46:44 -0800
committerScott Shawcroft <scott.shawcroft@gmail.com>2016-12-01 13:46:44 -0800
commitf4a1da4be901aaa880d7be80d8a24238382b4e09 (patch)
tree4420b50750b43a290cdbbd83171867b9933c341b /atmel-samd
parent8ef0dd095a5178babb75e48779a359abbf759ffa (diff)
atmel-samd: Only include bitbangio on boards with flash.
Diffstat (limited to 'atmel-samd')
-rw-r--r--atmel-samd/boards/arduino_zero/mpconfigboard.h2
-rw-r--r--atmel-samd/boards/cplay_m0_flash/mpconfigboard.h2
-rw-r--r--atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h2
-rw-r--r--atmel-samd/boards/feather_m0_basic/mpconfigboard.h2
-rw-r--r--atmel-samd/boards/feather_m0_flash/mpconfigboard.h2
-rw-r--r--atmel-samd/boards/gemma_m0/mpconfigboard.h2
-rw-r--r--atmel-samd/boards/metro_m0_flash/mpconfigboard.h2
-rw-r--r--atmel-samd/boards/trinket_m0/mpconfigboard.h2
-rw-r--r--atmel-samd/mpconfigport.h17
9 files changed, 28 insertions, 5 deletions
diff --git a/atmel-samd/boards/arduino_zero/mpconfigboard.h b/atmel-samd/boards/arduino_zero/mpconfigboard.h
index 16a929ddd..2cfa2c173 100644
--- a/atmel-samd/boards/arduino_zero/mpconfigboard.h
+++ b/atmel-samd/boards/arduino_zero/mpconfigboard.h
@@ -10,3 +10,5 @@
#define AUTORESET_DELAY_MS 500
#include "internal_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
diff --git a/atmel-samd/boards/cplay_m0_flash/mpconfigboard.h b/atmel-samd/boards/cplay_m0_flash/mpconfigboard.h
index f09962c20..47c23bbe0 100644
--- a/atmel-samd/boards/cplay_m0_flash/mpconfigboard.h
+++ b/atmel-samd/boards/cplay_m0_flash/mpconfigboard.h
@@ -20,3 +20,5 @@
#define AUTORESET_DELAY_MS 500
#include "spi_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000)
diff --git a/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h b/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h
index bd269ee32..e92b8842a 100644
--- a/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h
+++ b/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h
@@ -9,3 +9,5 @@
#define AUTORESET_DELAY_MS 500
#include "internal_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
diff --git a/atmel-samd/boards/feather_m0_basic/mpconfigboard.h b/atmel-samd/boards/feather_m0_basic/mpconfigboard.h
index 6fd7241eb..3dc84dddc 100644
--- a/atmel-samd/boards/feather_m0_basic/mpconfigboard.h
+++ b/atmel-samd/boards/feather_m0_basic/mpconfigboard.h
@@ -9,3 +9,5 @@
#define AUTORESET_DELAY_MS 500
#include "internal_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
diff --git a/atmel-samd/boards/feather_m0_flash/mpconfigboard.h b/atmel-samd/boards/feather_m0_flash/mpconfigboard.h
index eb616e1ce..c7ecd5346 100644
--- a/atmel-samd/boards/feather_m0_flash/mpconfigboard.h
+++ b/atmel-samd/boards/feather_m0_flash/mpconfigboard.h
@@ -21,3 +21,5 @@
#define AUTORESET_DELAY_MS 500
#include "spi_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000)
diff --git a/atmel-samd/boards/gemma_m0/mpconfigboard.h b/atmel-samd/boards/gemma_m0/mpconfigboard.h
index 20c0cb60b..ce91c84dd 100644
--- a/atmel-samd/boards/gemma_m0/mpconfigboard.h
+++ b/atmel-samd/boards/gemma_m0/mpconfigboard.h
@@ -8,3 +8,5 @@
#define AUTORESET_DELAY_MS 500
#include "internal_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
diff --git a/atmel-samd/boards/metro_m0_flash/mpconfigboard.h b/atmel-samd/boards/metro_m0_flash/mpconfigboard.h
index 848f14fdf..0c82d80e5 100644
--- a/atmel-samd/boards/metro_m0_flash/mpconfigboard.h
+++ b/atmel-samd/boards/metro_m0_flash/mpconfigboard.h
@@ -35,3 +35,5 @@
#define AUTORESET_DELAY_MS 500
#include "spi_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000)
diff --git a/atmel-samd/boards/trinket_m0/mpconfigboard.h b/atmel-samd/boards/trinket_m0/mpconfigboard.h
index 5f055d52f..1b4691d79 100644
--- a/atmel-samd/boards/trinket_m0/mpconfigboard.h
+++ b/atmel-samd/boards/trinket_m0/mpconfigboard.h
@@ -8,3 +8,5 @@
#define AUTORESET_DELAY_MS 500
#include "internal_flash.h"
+
+#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
diff --git a/atmel-samd/mpconfigport.h b/atmel-samd/mpconfigport.h
index 77412718a..dd04a67fd 100644
--- a/atmel-samd/mpconfigport.h
+++ b/atmel-samd/mpconfigport.h
@@ -111,6 +111,9 @@ typedef long mp_off_t;
#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
+// board specific definitions
+#include "mpconfigboard.h"
+
// extra built in modules to add to the list of known ones
extern const struct _mp_obj_module_t microcontroller_module;
extern const struct _mp_obj_module_t bitbangio_module;
@@ -121,21 +124,25 @@ extern const struct _mp_obj_module_t time_module;
extern const struct _mp_obj_module_t neopixel_write_module;
extern const struct _mp_obj_module_t uheap_module;
+#if BOARD_FLASH_SIZE > 192000
+ #define EXTRA_BUILTIN_MODULES \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module }
+#else
+ #define EXTRA_BUILTIN_MODULES
+#endif
+
#define MICROPY_PORT_BUILTIN_MODULES \
{ MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)&microcontroller_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_nativeio), (mp_obj_t)&nativeio_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&uos_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module }
+ { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module }, \
+ EXTRA_BUILTIN_MODULES
#define MICROPY_PORT_BUILTIN_DEBUG_MODULES \
{ MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module }
-// board specific definitions
-#include "mpconfigboard.h"
-
#ifndef MICROPY_PIN_DEFS_PORT_H
#define MICROPY_PIN_DEFS_PORT_H "pins.h"
#endif