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

[Taranis] DEBUG Tx now in its interrupt at 115200bauds

This commit is contained in:
bsongis@gmail.com 2013-05-19 22:17:54 +00:00
parent bea62a03ff
commit 0a719d9ec7
10 changed files with 47 additions and 44 deletions

View file

@ -41,7 +41,6 @@
#if !defined(SIMU)
Fifo<512> debugRxFifo;
Fifo<512> debugTxFifo;
// Outputs a string to the UART
void debugPuts(const char *format, ...)
@ -55,7 +54,7 @@ void debugPuts(const char *format, ...)
const char *t = tmp;
while (*t) {
debugTxFifo.push(*t++);
debugPutc(*t++);
}
}
@ -78,15 +77,10 @@ uint32_t Mem_address ;
uint32_t Next_mem_address ;
uint32_t Memaddmode ;
void txmit( uint8_t chr )
{
debugTxFifo.push( chr) ;
}
void crlf()
{
txmit( 13 ) ;
txmit( 10 ) ;
debugPutc( 13 ) ;
debugPutc( 10 ) ;
}
// Send a single 4 bit value to the RS232 port as a hex digit
@ -98,7 +92,7 @@ void hex_digit_send( unsigned char c )
c += 7 ;
}
c += '0' ;
txmit( c ) ;
debugPutc( c ) ;
}
// Send the 8 bit value to the RS232 port as 2 hex digits
@ -135,7 +129,7 @@ static void dispw_256( register uint32_t address, register uint32_t lines )
p8hex( address ) ;
for ( j = 0 ; j < 4 ; j += 1 )
{
txmit(' ') ;
debugPutc(' ') ;
p8hex( *( (uint32_t *)address ) ) ;
address += 4 ;
}
@ -165,7 +159,7 @@ void debugTask(void* pdata)
}
if ( ( ( rxchar >= '0' ) && ( rxchar <= '9' ) ) || ( ( rxchar >= 'A' ) && ( rxchar <= 'F' ) ) )
{
txmit( rxchar ) ;
debugPutc( rxchar ) ;
rxchar -= '0' ;
if ( rxchar > 9 )
{
@ -187,9 +181,9 @@ void debugTask(void* pdata)
}
else if ( rxchar == 8 )
{
txmit( rxchar ) ;
txmit( rxchar ) ;
txmit( rxchar ) ;
debugPutc( rxchar ) ;
debugPutc( rxchar ) ;
debugPutc( rxchar ) ;
Mem_address >>= 4 ;
}
else if ( rxchar == 27 )
@ -204,27 +198,18 @@ void debugTask(void* pdata)
{
Memaddmode = 1 ;
Mem_address = 0 ;
txmit( '>' ) ;
debugPutc( '>' ) ;
}
if ( rxchar == 'm' )
{
crlf() ;
p8hex( (uint32_t) &g_model.moduleData[0] ) ;
txmit( ' ' ) ;
debugPutc( ' ' ) ;
p8hex( (uint32_t) &g_model.moduleData[1] ) ;
crlf() ;
}
}
}
void debugTx(void)
{
uint8_t txchar;
if (debugTxFifo.pop(txchar))
debugPutc(txchar);
}
#endif