From f05337e0197464e34138ad02e83d75080500c5b0 Mon Sep 17 00:00:00 2001 From: MJ666 Date: Wed, 3 Oct 2018 00:47:22 +0200 Subject: [PATCH] Update Flash driver for generic target --- src/main/pg/flash.c | 4 ---- src/main/target/common_defaults_post.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/pg/flash.c b/src/main/pg/flash.c index 7c2632d8b..1ca604386 100644 --- a/src/main/pg/flash.c +++ b/src/main/pg/flash.c @@ -37,11 +37,7 @@ PG_REGISTER_WITH_RESET_FN(flashConfig_t, flashConfig, PG_FLASH_CONFIG, 0); void pgResetFn_flashConfig(flashConfig_t *flashConfig) { -#ifdef FLASH_CS_PIN flashConfig->csTag = IO_TAG(FLASH_CS_PIN); -#else - flashConfig->csTag = IO_TAG_NONE; -#endif flashConfig->spiDevice = SPI_DEV_TO_CFG(spiDeviceByInstance(FLASH_SPI_INSTANCE)); } #endif diff --git a/src/main/target/common_defaults_post.h b/src/main/target/common_defaults_post.h index dd84c323d..8284f59f0 100644 --- a/src/main/target/common_defaults_post.h +++ b/src/main/target/common_defaults_post.h @@ -30,6 +30,18 @@ #endif #endif +// pg/flash + +#ifdef USE_FLASH_M25P16 +#ifndef FLASH_CS_PIN +#define FLASH_CS_PIN NONE +#endif + +#ifndef FLASH_SPI_INSTANCE +#define FLASH_SPI_INSTANCE NULL +#endif +#endif + // pg/bus_i2c #ifdef I2C_FULL_RECONFIGURABILITY