1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 09:45:21 +03:00

[stock] Flash saving

[stock] More code removed when GPS=NO
[Taranis] Last EEPROM massstorage block (512 bytes) never written
[Taranis] Values displayed near the gauges
This commit is contained in:
bsongis@gmail.com 2013-05-21 18:35:59 +00:00
parent b0e49b8aaf
commit 6b412ed264
9 changed files with 166 additions and 150 deletions

View file

@ -79,8 +79,8 @@ uint32_t Memaddmode ;
void crlf()
{
debugPutc( 13 ) ;
debugPutc( 10 ) ;
debugPutc( 13 ) ;
debugPutc( 10 ) ;
}
// Send a single 4 bit value to the RS232 port as a hex digit
@ -140,75 +140,77 @@ static void dispw_256( register uint32_t address, register uint32_t lines )
void debugTask(void* pdata)
{
uint8_t rxchar ;
crlf() ;
dispw_256( (uint32_t)USART3, 4 ) ;
TRACE("DEBUG Task started");
crlf() ;
dispw_256( (uint32_t)USART3, 4 ) ;
for (;;) {
while ( (USART3->SR & USART_SR_RXNE) == 0 )
CoTickDelay(5); // 10ms
rxchar = USART3->DR ;
rxchar = USART3->DR;
if ( Memaddmode )
{
if ( ( rxchar >= 'a' ) && ( rxchar <= 'f' ) )
{
rxchar -= 0x20 ; // toupper!
}
if ( ( ( rxchar >= '0' ) && ( rxchar <= '9' ) ) || ( ( rxchar >= 'A' ) && ( rxchar <= 'F' ) ) )
{
debugPutc( rxchar ) ;
rxchar -= '0' ;
if ( rxchar > 9 )
{
rxchar -= 7 ;
}
Mem_address <<= 4 ;
Mem_address |= rxchar ;
}
else if ( rxchar == 13 )
{
crlf() ;
if ( Mem_address == 0 )
{
Mem_address = Next_mem_address ;
}
dispw_256( Mem_address, 4 ) ;
Next_mem_address = Mem_address + 64 ;
Memaddmode = 0 ;
}
else if ( rxchar == 8 )
{
debugPutc( rxchar ) ;
debugPutc( rxchar ) ;
debugPutc( rxchar ) ;
Mem_address >>= 4 ;
}
else if ( rxchar == 27 )
{
crlf() ;
Memaddmode = 0 ;
}
if ( Memaddmode )
{
if ( ( rxchar >= 'a' ) && ( rxchar <= 'f' ) )
{
rxchar -= 0x20; // toupper!
}
if ( ( ( rxchar >= '0' ) && ( rxchar <= '9' ) ) || ( ( rxchar >= 'A' ) && ( rxchar <= 'F' ) ) )
{
debugPutc( rxchar );
rxchar -= '0';
if ( rxchar > 9 )
{
rxchar -= 7;
}
Mem_address <<= 4;
Mem_address |= rxchar;
}
else if ( rxchar == 13 )
{
crlf();
if ( Mem_address == 0 )
{
Mem_address = Next_mem_address;
}
dispw_256( Mem_address, 4 );
Next_mem_address = Mem_address + 64;
Memaddmode = 0;
}
else if ( rxchar == 8 )
{
debugPutc( rxchar );
debugPutc( rxchar );
debugPutc( rxchar );
Mem_address >>= 4;
}
else if ( rxchar == 27 )
{
crlf();
Memaddmode = 0;
}
}
}
if ( rxchar == '?' )
{
Memaddmode = 1 ;
Mem_address = 0 ;
debugPutc( '>' ) ;
}
if ( rxchar == '?' )
{
Memaddmode = 1;
Mem_address = 0;
debugPutc( '>' );
}
if ( rxchar == 'm' )
{
crlf() ;
p8hex( (uint32_t) &g_model.moduleData[0] ) ;
debugPutc( ' ' ) ;
p8hex( (uint32_t) &g_model.moduleData[1] ) ;
crlf() ;
}
if ( rxchar == 'm' )
{
crlf();
p8hex( (uint32_t) &g_model.moduleData[0] );
debugPutc( ' ' );
p8hex( (uint32_t) &g_model.moduleData[1] );
crlf();
}
}
}