first config of the EUSART and TMR
This commit is contained in:
		| @@ -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 | ||||||
| */ | */ | ||||||
		Reference in New Issue
	
	Block a user