Divided USART communication into core and protocol classes

This commit is contained in:
Attila Body 2019-11-07 08:33:48 +01:00
parent 9ff4e76623
commit f0c2ad69c9
7 changed files with 287 additions and 121 deletions

View file

@ -46,7 +46,8 @@ void _PrintStats(char *buffer, uint8_t id, f4ll::LL_HsUsart &handler, USART_Type
buffer += uitohex(buffer, stats.pep1, 8);
buffer += strcpy_ex(buffer,",0x");
buffer += uitohex(buffer, stats.pep2, 8);
ADDINFO(buffer, " de: ", stats.dmaError);
ADDINFO(buffer, " rde: ", stats.rxDmaError);
ADDINFO(buffer, " tde: ", stats.txDmaError);
ADDINFO(buffer, " pmh: ", stats.premature_hdr);
ADDINFO(buffer, " pmp: ", stats.premature_payload);
buffer += strcpy_ex(buffer, "\r\n");
@ -69,7 +70,7 @@ extern "C" void MainLoop()
f4ll::LL_HsUsart u3{ USART3, DMA1, LL_DMA_STREAM_1, LL_DMA_STREAM_3 };
f4ll::LL_HsUsart u6{ USART6, DMA2, LL_DMA_STREAM_1, LL_DMA_STREAM_6 };
f4ll::LL_HsUsart * usarts[] = { & u1, &u2, &u3, &u6 };
f4ll::LL_HsUsart * usarts[] = { &u1, &u2, &u3, &u6 };
for(unsigned int i=0; i < sizeof(usarts) / sizeof(usarts[0]); ++i)
g_usarts[i] = usarts[i];