first config of the EUSART and TMR

This commit is contained in:
Rémi Heredero 2023-03-03 15:00:03 +01:00
parent 756749c7a7
commit c73442dc0b

View File

@ -49,6 +49,9 @@
/* /*
Main application Main application
*/ */
void resetTMR0();
void endFrame();
void main(void) void main(void)
{ {
// Initialize the device // Initialize the device
@ -65,17 +68,19 @@ void main(void)
// Use the following macros to: // Use the following macros to:
// Enable the Global Interrupts // Enable the Global Interrupts
//INTERRUPT_GlobalInterruptEnable(); INTERRUPT_GlobalInterruptEnable();
// Disable the Global Interrupts // Disable the Global Interrupts
//INTERRUPT_GlobalInterruptDisable(); //INTERRUPT_GlobalInterruptDisable();
// Enable the Peripheral Interrupts // Enable the Peripheral Interrupts
//INTERRUPT_PeripheralInterruptEnable(); INTERRUPT_PeripheralInterruptEnable();
// Disable the Peripheral Interrupts // Disable the Peripheral Interrupts
//INTERRUPT_PeripheralInterruptDisable(); //INTERRUPT_PeripheralInterruptDisable();
uint16_t foo = 512; uint16_t foo = 512;
EUSART1_SetRxInterruptHandler(resetTMR0());
TMR0_SetInterruptHandler(endFrame());
while (1) while (1)
{ {
foo = ++foo%1023; foo = ++foo%1023;
@ -94,6 +99,17 @@ void main(void)
} }
} }
void resetTMR0(){
TMR0_Reload();
TMR0_StartTimer();
INTCONbits.TMR0IF = 0;
}
void endFrame(){
// TODO
}
/** /**
End of File End of File
*/ */