Serial RX count bug fix. Settings codes CSV. More documentation.

- Reverted back the serial RX count function to how it was. The
variable type was unsigned and cause an integer underflow whenever the
calculation produced a negative number. The old way was the correct way.

- Lots of minor edits to the code CSVs and markdown documents.

- Expanded on explaining feedback messages and startup line execution
feedback.

- Created a new settings codes CSV to help GUIs import the values and
meanings.
This commit is contained in:
Sonny Jeon
2016-09-24 14:41:41 -06:00
parent e51e691eeb
commit c0f61e4aac
9 changed files with 207 additions and 201 deletions

View File

@ -41,9 +41,9 @@ volatile uint8_t serial_tx_buffer_tail = 0;
// Returns the number of bytes used in the RX serial buffer.
uint8_t serial_get_rx_buffer_count()
{
uint8_t diff = serial_rx_buffer_head-serial_rx_buffer_tail;
if (diff >= 0) { return(diff); }
return (RX_RING_BUFFER + diff);
uint8_t rtail = serial_rx_buffer_tail; // Copy to limit multiple calls to volatile
if (serial_rx_buffer_head >= rtail) { return(serial_rx_buffer_head-rtail); }
return (RX_BUFFER_SIZE - (rtail-serial_rx_buffer_head));
}