diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-10-02 14:45:56 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-10-02 14:45:56 -0400 |
| commit | 99be520563834d51eb3ddd32b757a3dcd2486632 (patch) | |
| tree | 7c31bcc262950d431a1676b62624b6ac82f30df3 /fw/tests/system/eeprom_systest.c | |
| parent | c91e3d96c90cd1c9b3b6155bc5e37954011cf0af (diff) | |
| download | can-gauge-interface-99be520563834d51eb3ddd32b757a3dcd2486632.zip | |
spi systest
Diffstat (limited to 'fw/tests/system/eeprom_systest.c')
| -rw-r--r-- | fw/tests/system/eeprom_systest.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/fw/tests/system/eeprom_systest.c b/fw/tests/system/eeprom_systest.c index 9099345..81fa189 100644 --- a/fw/tests/system/eeprom_systest.c +++ b/fw/tests/system/eeprom_systest.c @@ -2,20 +2,43 @@ #include <stdint.h> +#include "system.h" #include "types.h" -#include "init.h" #include "spi.h" #include "eeprom.h" -#include "config.h" +#include "usb.h" void main(void) { - clockInit(); - pinsInit(); + sysInit(); spiInit(); eepromInit(); + usbInit(); + + T1CON = 0; + T1CONbits.TMR1CS = 0x0; // FOSC/4 + T1CONbits.T1CKPS = 0x3; // 1:8 prescaler + T1CONbits.TMR1ON = 1; + + TMR1IE = 1; + TMR1IF = 0; + PEIE = 1; + GIE = 1; for (;;) { } } + +void +__interrupt() isr(void) { + static U8 ctr = 0u; + + if (TMR1IF) { + if (ctr == 23u) { // 1s period + + } + ctr = (ctr+1u) % 23u; + TMR1IF = 0; + } +} |