mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 22:58:10 +00:00
C8 MCU flash size check (#461)
This commit is contained in:
parent
36675cf729
commit
627d47f139
@ -732,6 +732,15 @@ enum {
|
|||||||
#define DSM_RX_EEPROM_OFFSET 877 // (4) TX ID + format, 5 bytes, end is 882
|
#define DSM_RX_EEPROM_OFFSET 877 // (4) TX ID + format, 5 bytes, end is 882
|
||||||
//#define CONFIG_EEPROM_OFFSET 882 // Current configuration of the multimodule
|
//#define CONFIG_EEPROM_OFFSET 882 // Current configuration of the multimodule
|
||||||
|
|
||||||
|
/* STM32 Flash Size */
|
||||||
|
#ifndef DISABLE_FLASH_SIZE_CHECK
|
||||||
|
#ifdef MCU_STM32F103C8
|
||||||
|
#define MCU_EXPECTED_FLASH_SIZE 64 // STM32F103C8 has 64KB of flash space
|
||||||
|
#else
|
||||||
|
#define MCU_EXPECTED_FLASH_SIZE 128 // STM32F103CB has 128KB of flash space
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
//****************************************
|
//****************************************
|
||||||
//*** MULTI protocol serial definition ***
|
//*** MULTI protocol serial definition ***
|
||||||
//****************************************
|
//****************************************
|
||||||
|
@ -374,7 +374,7 @@ void setup()
|
|||||||
#ifndef DISABLE_FLASH_SIZE_CHECK
|
#ifndef DISABLE_FLASH_SIZE_CHECK
|
||||||
unsigned short *flashSize = (unsigned short *) (0x1FFFF7E0);// Address register
|
unsigned short *flashSize = (unsigned short *) (0x1FFFF7E0);// Address register
|
||||||
debugln("Module Flash size: %dKB",(int)(*flashSize & 0xffff));
|
debugln("Module Flash size: %dKB",(int)(*flashSize & 0xffff));
|
||||||
if((int)(*flashSize & 0xffff) < 128) // Not supported by this project
|
if((int)(*flashSize & 0xffff) < MCU_EXPECTED_FLASH_SIZE) // Not supported by this project
|
||||||
while (true) { //SOS
|
while (true) { //SOS
|
||||||
for(uint8_t i=0; i<3;i++)
|
for(uint8_t i=0; i<3;i++)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user