diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8dfbc93..2f753e4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @JasonBrave +* @JasonBrave @Pdada1 diff --git a/board.h b/board.h index 1a69d77..3fb0065 100644 --- a/board.h +++ b/board.h @@ -1,10 +1,6 @@ #ifndef BOARD_H #define BOARD_H -#define MAX_TC_TIME_DIFF_ms 200 -#define MAX_HEARTBEAT_TIME_DIFF_ms 2000 -#define MAX_BUS_DEAD_TIME_ms 2000 - #define RED_LED_ON() (LATB3 = 0) #define RED_LED_OFF() (LATB3 = 1) #define RED_LED_TOGGLE() (LATB3 ^= 1) diff --git a/canlib b/canlib index 999c3b3..b3b2e1c 160000 --- a/canlib +++ b/canlib @@ -1 +1 @@ -Subproject commit 999c3b32b5b1e140f5ae1ad69b5cf7d31ba2c852 +Subproject commit b3b2e1c9aaedf7a4ede3d33cf74da5c934a7fe29 diff --git a/main.c b/main.c index a1e700b..2966a68 100644 --- a/main.c +++ b/main.c @@ -10,6 +10,10 @@ #include "spi.h" #include "thermocouple.h" +#define MAX_TC_TIME_DIFF_ms 200 // 5 Hz +#define MAX_HEARTBEAT_TIME_DIFF_ms 500 // 2 Hz +#define MAX_BUS_DEAD_TIME_ms 5000 // 5 s + #if (BOARD_UNIQUE_ID == BOARD_ID_THERMOCOUPLE_1) #define build_tc_temp_data_msg(timestamp, id, temp, msg) \ build_temp_data_msg(timestamp, id, temp, msg); diff --git a/rocketlib b/rocketlib index 126a2a8..b911cef 160000 --- a/rocketlib +++ b/rocketlib @@ -1 +1 @@ -Subproject commit 126a2a8db2b6f2947b5fd6b63cb9a65233f6045f +Subproject commit b911cef3085efe0017b63429b53cf569c11994f5 diff --git a/spi.c b/spi.c index 0081f82..5452034 100644 --- a/spi.c +++ b/spi.c @@ -26,14 +26,13 @@ void spi1_init(void) { SPI1CON0bits.EN = 1; // enable SPI } -/**/ uint8_t spi1_exchange(uint8_t data) { INTCON0bits.GIE = 0; SPI1CON2bits.TXR = 0; SPI1CON2bits.RXR = 1; SPI1TCNT = 1; SPI1TXB = data; /*if we're sending data, send it. if we're recieving, this is 0 (unless you - // initialized bad), but makes sure we output a clock*/ + initialized bad), but makes sure we output a clock*/ while (!PIR2bits.SPI1RXIF) { } // wait until receive buffer is not empty?? (basically until theres a clock) data = SPI1RXB; @@ -45,7 +44,7 @@ void spi1_exchange_buffer(uint8_t *data, uint8_t data_len) { // set data length SPI1TCNTL = data_len; SPI1TCNTH = 0; - // uint8_t *block = data; + while (data_len) { *data = spi1_exchange(*data); // sends pointer, so data gets shoved into array data++; // increment array