Simplify the flash-display conflict fix
This commit is contained in:
parent
2afca4e942
commit
70932cab42
@ -38,7 +38,7 @@
|
||||
#define BOARD_OSC_DIV 12
|
||||
#define BOARD_NO_VBUS_SENSE
|
||||
//#define BOARD_VTOR_DEFER //Leave VTOR relocation to bootloader
|
||||
#define SHOW_FLASH_SPI
|
||||
#define BOARD_USE_INTERNAL_SPI
|
||||
|
||||
// On-board flash
|
||||
#define SPI_FLASH_MOSI_PIN (&pin_PB15)
|
||||
|
@ -296,7 +296,6 @@ extern const struct _mp_obj_module_t board_module;
|
||||
#define BOARD_I2C (defined(DEFAULT_I2C_BUS_SDA) && defined(DEFAULT_I2C_BUS_SCL))
|
||||
#define BOARD_SPI (defined(DEFAULT_SPI_BUS_SCK) && defined(DEFAULT_SPI_BUS_MISO) && defined(DEFAULT_SPI_BUS_MOSI))
|
||||
#define BOARD_UART (defined(DEFAULT_UART_BUS_RX) && defined(DEFAULT_UART_BUS_TX))
|
||||
#define BOARD_INTERNAL_SPI (defined(SHOW_FLASH_SPI))
|
||||
|
||||
// I2C and SPI are always allocated off the heap.
|
||||
|
||||
|
@ -37,8 +37,6 @@ mp_obj_t common_hal_board_get_i2c(void);
|
||||
mp_obj_t common_hal_board_create_i2c(void);
|
||||
MP_DECLARE_CONST_FUN_OBJ_0(board_i2c_obj);
|
||||
|
||||
mp_obj_t common_hal_board_get_internal_spi(void);
|
||||
|
||||
mp_obj_t common_hal_board_get_spi(void);
|
||||
mp_obj_t common_hal_board_create_spi(void);
|
||||
MP_DECLARE_CONST_FUN_OBJ_0(board_spi_obj);
|
||||
|
@ -29,8 +29,6 @@
|
||||
#include "mpconfigboard.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
#include "supervisor/spi_flash_api.h"
|
||||
|
||||
#if CIRCUITPY_BUSIO
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
@ -91,15 +89,6 @@ mp_obj_t common_hal_board_create_spi(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOARD_INTERNAL_SPI
|
||||
//Provide a reference to the internal SPI, if required.
|
||||
mp_obj_t common_hal_board_get_internal_spi(void) {
|
||||
//TODO: can we change the name of this without having to change every instance of spi in every
|
||||
//flash file?
|
||||
return (mp_obj_t)(&spi);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOARD_UART
|
||||
mp_obj_t common_hal_board_get_uart(void) {
|
||||
return MP_STATE_VM(shared_uart_bus);
|
||||
|
@ -16,6 +16,9 @@
|
||||
#include "supervisor/shared/display.h"
|
||||
#include "supervisor/memory.h"
|
||||
|
||||
#include "supervisor/spi_flash_api.h"
|
||||
#include "py/mpconfig.h"
|
||||
|
||||
primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT];
|
||||
|
||||
// Check for recursive calls to displayio_background.
|
||||
@ -100,8 +103,8 @@ void reset_displays(void) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if BOARD_INTERNAL_SPI
|
||||
if (original_spi == common_hal_board_get_internal_spi()) {
|
||||
#ifdef BOARD_USE_INTERNAL_SPI
|
||||
if (original_spi == (mp_obj_t)(&spi)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user