full reading done

This commit is contained in:
Rémi Heredero 2023-03-10 13:39:55 +01:00
parent 5397036918
commit 5e1a035517

11
main.c
View File

@ -53,6 +53,9 @@
void resetTMR0(void);
void endFrame(void);
uint8_t nRxByte = 0;
extern uint8_t rx_buf[256];
void main(void)
{
// Initialize the device
@ -104,18 +107,14 @@ void main(void)
void resetTMR0(void){
volatile uint8_t dummy;
dummy = EUSART1_Read();
rx_buf[nRxByte++] = RCREG1;
TMR0_Reload();
TMR0_StartTimer();
}
void endFrame(void){
INTCONbits.TMR0IF = 0;
nRxByte = 0;
TMR0_StopTimer();
modbus_analyse_and_answer();