@@ -39,15 +39,15 @@ static void uart_interrupt_handler (void);
3939//
4040// serialGetC - returns -1 if no data available
4141//
42- static int16_t serialGetC (void )
42+ static int32_t serialGetC (void )
4343{
44- int16_t data ;
44+ int32_t data ;
4545 uint_fast16_t bptr = rxbuffer .tail ;
4646
4747 if (bptr == rxbuffer .head )
4848 return -1 ; // no data available else EOF
4949
50- data = rxbuffer .data [bptr ++ ]; // Get next character, increment tmp pointer
50+ data = ( int32_t ) rxbuffer .data [bptr ++ ]; // Get next character, increment tmp pointer
5151 rxbuffer .tail = bptr & (RX_BUFFER_SIZE - 1 ); // and update pointer
5252
5353 return data ;
@@ -78,7 +78,7 @@ static void serialRxCancel (void)
7878 rxbuffer .head = (rxbuffer .tail + 1 ) & (RX_BUFFER_SIZE - 1 );
7979}
8080
81- static bool serialPutC (const char c )
81+ static bool serialPutC (const uint8_t c )
8282{
8383 uint_fast16_t next_head ;
8484
@@ -102,7 +102,7 @@ static bool serialPutC (const char c)
102102
103103static void serialWriteS (const char * data )
104104{
105- char c , * ptr = (char * )data ;
105+ uint8_t c , * ptr = (uint8_t * )data ;
106106
107107 while ((c = * ptr ++ ) != '\0' )
108108 serialPutC (c );
@@ -189,9 +189,9 @@ static void uart_interrupt_handler (void)
189189 uart .rx_irq = 0 ;
190190 if (data == 0x06 )
191191 sim .exit = exit_REQ ;
192- if (!enqueue_realtime_command ((char )data )) {
193- rxbuffer .data [rxbuffer .head ] = (char )data ; // Add data to buffer
194- rxbuffer .head = bptr ; // and update pointer
192+ if (!enqueue_realtime_command ((uint8_t )data )) {
193+ rxbuffer .data [rxbuffer .head ] = (uint8_t )data ; // Add data to buffer
194+ rxbuffer .head = bptr ; // and update pointer
195195 }
196196 }
197197 }
0 commit comments