diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-02-12 14:30:29 -0500 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-02-12 14:30:29 -0500 |
| commit | 7831c475b9f38d8db8e2b8b62bc110f99185b8cb (patch) | |
| tree | 04708ac7fe2debec8f82f4897c7066748a52df9b | |
| parent | b4c60c3355ca410809c842d7d129f54b60222338 (diff) | |
change flag styling
| -rw-r--r-- | ports/stm32f4/boards/espruino_pico/mpconfigboard.h | 4 | ||||
| -rw-r--r-- | ports/stm32f4/boards/espruino_wifi/mpconfigboard.h | 4 | ||||
| -rw-r--r-- | ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h | 2 | ||||
| -rw-r--r-- | ports/stm32f4/boards/meowbit_v121/mpconfigboard.h | 8 | ||||
| -rw-r--r-- | ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h | 6 | ||||
| -rw-r--r-- | ports/stm32f4/boards/pyboard_v11/mpconfigboard.h | 1 | ||||
| -rw-r--r-- | ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h | 8 | ||||
| -rw-r--r-- | ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h | 2 | ||||
| -rw-r--r-- | ports/stm32f4/mpconfigport.h | 14 | ||||
| -rw-r--r-- | ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c | 2 | ||||
| -rw-r--r-- | ports/stm32f4/supervisor/usb.c | 2 | ||||
| -rw-r--r-- | ports/stm32f4/system_stm32f4xx.c | 2 | ||||
| -rw-r--r-- | shared-module/displayio/__init__.c | 2 |
13 files changed, 35 insertions, 22 deletions
diff --git a/ports/stm32f4/boards/espruino_pico/mpconfigboard.h b/ports/stm32f4/boards/espruino_pico/mpconfigboard.h index aa179c793..d4430380c 100644 --- a/ports/stm32f4/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm32f4/boards/espruino_pico/mpconfigboard.h @@ -32,8 +32,8 @@ #define FLASH_SIZE (0x60000) #define FLASH_PAGE_SIZE (0x4000) -#define AUTORESET_DELAY_MS 500 +#define AUTORESET_DELAY_MS (500) #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) -#define BOARD_OSC_DIV 8 +#define BOARD_OSC_DIV (8) diff --git a/ports/stm32f4/boards/espruino_wifi/mpconfigboard.h b/ports/stm32f4/boards/espruino_wifi/mpconfigboard.h index 611a41d93..abdc9e8fa 100644 --- a/ports/stm32f4/boards/espruino_wifi/mpconfigboard.h +++ b/ports/stm32f4/boards/espruino_wifi/mpconfigboard.h @@ -32,5 +32,5 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K -#define BOARD_OSC_DIV 8 -#define BOARD_OVERWRITE_SWD +#define BOARD_OSC_DIV (8) +#define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h index ad9bba7b0..4670b9893 100644 --- a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h @@ -42,7 +42,7 @@ // Bootloader only #ifdef UF2_BOOTLOADER_ENABLED - #define BOARD_VTOR_DEFER //Leave VTOR relocation to bootloader + #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader #endif #define DEFAULT_I2C_BUS_SCL (&pin_PB06) diff --git a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h index c849e03b6..70ae866fe 100644 --- a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h +++ b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h @@ -35,10 +35,10 @@ #define AUTORESET_DELAY_MS 500 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) -#define BOARD_OSC_DIV 12 -#define BOARD_NO_VBUS_SENSE -#define BOARD_VTOR_DEFER //Leave VTOR relocation to bootloader -#define BOARD_USE_INTERNAL_SPI +#define BOARD_OSC_DIV (12) +#define BOARD_NO_VBUS_SENSE (1) +#define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader +#define BOARD_USE_INTERNAL_SPI (1) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB15) diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h index 7980ca93d..965e7d5ff 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h @@ -32,7 +32,7 @@ #define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV 8 +#define BOARD_OSC_DIV (8) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB15) @@ -40,8 +40,8 @@ #define SPI_FLASH_SCK_PIN (&pin_PB13) #define SPI_FLASH_CS_PIN (&pin_PB12) -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 +#define CIRCUITPY_AUTORELOAD_DELAY_MS (500) #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) -#define AUTORESET_DELAY_MS 500 +#define AUTORESET_DELAY_MS (500) diff --git a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h index 7093442d0..b48a775ae 100644 --- a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h @@ -32,6 +32,5 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) - #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h index 05e2a384a..2ae1a2926 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -32,8 +32,8 @@ #define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV 25 -#define BOARD_NO_VBUS_SENSE +#define BOARD_OSC_DIV (25) +#define BOARD_NO_VBUS_SENSE (1) // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) @@ -41,8 +41,8 @@ // #define SPI_FLASH_SCK_PIN (&pin_PA05) // #define SPI_FLASH_CS_PIN (&pin_PA04) -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 +#define CIRCUITPY_AUTORELOAD_DELAY_MS (500) #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) -#define AUTORESET_DELAY_MS 500 +#define AUTORESET_DELAY_MS (500) diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h index 7a5335407..49ef80cdd 100644 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h @@ -32,4 +32,4 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K -#define BOARD_OSC_DIV 8 +#define BOARD_OSC_DIV (8) diff --git a/ports/stm32f4/mpconfigport.h b/ports/stm32f4/mpconfigport.h index 7737bda8d..931a56ed2 100644 --- a/ports/stm32f4/mpconfigport.h +++ b/ports/stm32f4/mpconfigport.h @@ -37,6 +37,20 @@ // 24kiB stack #define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 +//Board flags: +#ifndef BOARD_OVERWRITE_SWD +#define BOARD_OVERWRITE_SWD (0) +#endif +#ifndef BOARD_VTOR_DEFER +#define BOARD_VTOR_DEFER (0) +#endif +#ifndef BOARD_NO_VBUS_SENSE +#define BOARD_NO_VBUS_SENSE (0) +#endif +#ifndef BOARD_USE_INTERNAL_SPI +#define BOARD_USE_INTERNAL_SPI (0) +#endif + #include "py/circuitpy_mpconfig.h" #define MAX_UART 10 //how many UART are implemented diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c index 77888c465..aee0bd5eb 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c @@ -42,7 +42,7 @@ void stm32f4_peripherals_gpio_init(void) { never_reset_pin_number(2,14); //PC14 OSC32_IN never_reset_pin_number(2,15); //PC15 OSC32_OUT - #if !defined(BOARD_OVERWRITE_SWD) + #if !(BOARD_OVERWRITE_SWD) never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK #endif diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index afafe26a9..358c2de5b 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -38,7 +38,7 @@ STATIC void init_usb_vbus_sense(void) { -#ifdef BOARD_NO_VBUS_SENSE +#if (BOARD_NO_VBUS_SENSE) // Disable VBUS sensing #ifdef USB_OTG_GCCFG_VBDEN USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; diff --git a/ports/stm32f4/system_stm32f4xx.c b/ports/stm32f4/system_stm32f4xx.c index bce420056..caa4f9caf 100644 --- a/ports/stm32f4/system_stm32f4xx.c +++ b/ports/stm32f4/system_stm32f4xx.c @@ -218,7 +218,7 @@ void SystemInit(void) #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /* Configure the Vector Table location add offset address ------------------*/ -#if !defined(BOARD_VTOR_DEFER) //only set VTOR if the bootloader hasn't already +#if !(BOARD_VTOR_DEFER) //only set VTOR if the bootloader hasn't already #ifdef VECT_TAB_SRAM SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ #else diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index efa61265e..daf7a2046 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -103,7 +103,7 @@ void reset_displays(void) { continue; } #endif - #ifdef BOARD_USE_INTERNAL_SPI + #if (BOARD_USE_INTERNAL_SPI) if (original_spi == (mp_obj_t)(&supervisor_flash_spi_bus)) { continue; } |
