vasko ozo
/
F031K6_TxRxService
Test1
Diff: main.cpp
- Revision:
- 3:7cdb20aac969
- Parent:
- 2:56a194afd255
- Child:
- 4:d461cadeb702
--- a/main.cpp Fri Aug 02 20:20:18 2019 +0000 +++ b/main.cpp Sat Aug 03 12:24:10 2019 +0000 @@ -24,19 +24,23 @@ } } +void CopyUint8(uint8_t *src = &ArrRx[0], uint8_t *dst = &ArrTx[0], int qty = ArrTxSize){ + for ( ; qty > 0; src++,dst++,qty-- ) *dst = *src; + } + void IntrRx() { ArrRx[nCharRx++] = pc.getc(); if (nCharRx >= ArrRxSize ) { - for(int i = 0; i < ArrTxSize; i++){ - ArrTx[i] = ArrRx[i]; - } + CopyUint8(); nCharTx = 0; pc.putc(ArrTx[nCharTx]); pc.attach(&IntrTx, Serial::TxIrq); nCharRx = 0; myled=1; } + } + int main() { pc.attach(&IntrRx, Serial::RxIrq);