improve output labelling and format
This commit is contained in:
parent
f43f092a00
commit
e25180853b
1 changed files with 5 additions and 4 deletions
|
|
@ -204,6 +204,7 @@ int main() {
|
||||||
gpio_put(23, 1);
|
gpio_put(23, 1);
|
||||||
|
|
||||||
printf("\n============================================\n");
|
printf("\n============================================\n");
|
||||||
|
printf( "MCU Board State:\n" );
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
// print out the battery charging state, also set LED colour code
|
// print out the battery charging state, also set LED colour code
|
||||||
|
|
@ -274,7 +275,7 @@ int main() {
|
||||||
} while (melopero.checkRxFifo(500)); // Keep checking the FIFO for new data
|
} while (melopero.checkRxFifo(500)); // Keep checking the FIFO for new data
|
||||||
|
|
||||||
// NOTE: the rxbuff_ptr could be < or > actual buffer length
|
// NOTE: the rxbuff_ptr could be < or > actual buffer length
|
||||||
printf( "Received Data:\n length=%d (buflen=%d)\n data={", rxbuff_ptr, sizeof(rxbuff) );
|
printf( "Received Data Info:\n length=%d (buflen=%d)\n data={", rxbuff_ptr, sizeof(rxbuff) );
|
||||||
uint32_t checksum = 0;
|
uint32_t checksum = 0;
|
||||||
size_t safelen = (rxbuff_ptr < sizeof(rxbuff)) ? rxbuff_ptr : sizeof(rxbuff);
|
size_t safelen = (rxbuff_ptr < sizeof(rxbuff)) ? rxbuff_ptr : sizeof(rxbuff);
|
||||||
for (size_t i = 0; i < safelen ; i++) {
|
for (size_t i = 0; i < safelen ; i++) {
|
||||||
|
|
@ -288,7 +289,7 @@ int main() {
|
||||||
struct rxdata rxd = {};
|
struct rxdata rxd = {};
|
||||||
deseralise_rxdata( rxbuff, &rxd );
|
deseralise_rxdata( rxbuff, &rxd );
|
||||||
|
|
||||||
printf( "Received:\n" );
|
printf( "Deserialised Packet Info:\n" );
|
||||||
printf( " Data Length: %u bytes\n", rxd.length );
|
printf( " Data Length: %u bytes\n", rxd.length );
|
||||||
printf( " Options: 0x%08X (bitfield)\n", rxd.options );
|
printf( " Options: 0x%08X (bitfield)\n", rxd.options );
|
||||||
printf( " WTF: 0x%02X (undocumented field?)\n", rxd.wtf );
|
printf( " WTF: 0x%02X (undocumented field?)\n", rxd.wtf );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue