Add DISABLE_FLASH_SIZE_CHECK

This commit is contained in:
Pascal Langer 2020-09-09 16:47:32 +02:00
parent a2213fd6dc
commit d5346c0eaf
2 changed files with 30 additions and 28 deletions

View File

@ -201,7 +201,7 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
packet[i*2+5]=DSM_SerialRX_val[i+1];
}
DSM_SerialRX=false;
#if DSM_DEBUG_FWD_PGM
#ifdef DSM_DEBUG_FWD_PGM
debug("FWD=");
for(uint8_t i=4; i<16;i++)
debug(" %02X",packet[i]);
@ -388,7 +388,7 @@ uint16_t ReadDsm()
if(len>TELEMETRY_BUFFER_SIZE-2)
len=TELEMETRY_BUFFER_SIZE-2;
CYRF_ReadDataPacketLen(packet_in+1, len);
#if DSM_DEBUG_FWD_PGM
#ifdef DSM_DEBUG_FWD_PGM
//debug(" %02X", packet_in[1]);
if(packet_in[1]==9)
{

View File

@ -371,34 +371,36 @@ void setup()
init_HWTimer(); //0.5us
//Read module flash size
unsigned short *flashSize = (unsigned short *) (0x1FFFF7E0);// Address register
debugln("Module Flash size: %dKB",(int)(*flashSize & 0xffff));
if((int)(*flashSize & 0xffff) < 128) // Not supported by this project
while (true) { //SOS
for(uint8_t i=0; i<3;i++)
{
LED_on;
delay(100);
#ifndef DISABLE_FLASH_SIZE_CHECK
unsigned short *flashSize = (unsigned short *) (0x1FFFF7E0);// Address register
debugln("Module Flash size: %dKB",(int)(*flashSize & 0xffff));
if((int)(*flashSize & 0xffff) < 128) // Not supported by this project
while (true) { //SOS
for(uint8_t i=0; i<3;i++)
{
LED_on;
delay(100);
LED_off;
delay(100);
}
for(uint8_t i=0; i<3;i++)
{
LED_on;
delay(500);
LED_off;
delay(100);
}
for(uint8_t i=0; i<3;i++)
{
LED_on;
delay(100);
LED_off;
delay(100);
}
LED_off;
delay(100);
delay(1000);
}
for(uint8_t i=0; i<3;i++)
{
LED_on;
delay(500);
LED_off;
delay(100);
}
for(uint8_t i=0; i<3;i++)
{
LED_on;
delay(100);
LED_off;
delay(100);
}
LED_off;
delay(1000);
}
#endif
#else
//ATMEGA328p
// all inputs