read 1 byte and detect end frame: done

This commit is contained in:
Rémi Heredero 2023-03-10 13:23:14 +01:00
parent 649f9d2968
commit 5397036918

8
main.c
View File

@ -104,12 +104,18 @@ void main(void)
void resetTMR0(void){ void resetTMR0(void){
INTCONbits.TMR0IF = 0; volatile uint8_t dummy;
dummy = EUSART1_Read();
TMR0_Reload(); TMR0_Reload();
TMR0_StartTimer(); TMR0_StartTimer();
} }
void endFrame(void){ void endFrame(void){
INTCONbits.TMR0IF = 0;
TMR0_StopTimer(); TMR0_StopTimer();
modbus_analyse_and_answer(); modbus_analyse_and_answer();