summaryrefslogtreecommitdiff
path: root/gm_platform/fw/adc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gm_platform/fw/adc.c')
-rw-r--r--gm_platform/fw/adc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gm_platform/fw/adc.c b/gm_platform/fw/adc.c
index e3aba5b..ab9d6b5 100644
--- a/gm_platform/fw/adc.c
+++ b/gm_platform/fw/adc.c
@@ -25,6 +25,7 @@
static struct __attribute__((__packed__)) hl_adc_pkt {
struct ll_pkt ll;
uint16_t seq;
+ int32_t gps_1pps_period_sysclk;
volatile uint16_t data[32];
} adc_pkt[2];
static uint16_t current_seq = 0;
@@ -99,7 +100,7 @@ static void adc_timer_init(int psc, int ivl) {
TIM1->PSC = psc-1;
TIM1->ARR = ivl-1;
/* Preload all values */
- TIM1->EGR |= TIM_EGR_UG;
+ TIM1->EGR = TIM_EGR_UG;
TIM1->CR1 = TIM_CR1_ARPE;
/* And... go! */
TIM1->CR1 |= TIM_CR1_CEN;
@@ -118,6 +119,7 @@ void DMA1_Channel1_IRQHandler(void) {
gdb_dump();
adc_pkt[!current_buf].seq = current_seq++;
+ adc_pkt[!current_buf].gps_1pps_period_sysclk = gps_1pps_period_sysclk;
/* Ignore return value since we can't do anything here. Overruns are logged in serial.c. */
usart_send_packet_nonblocking(&adc_pkt[!current_buf].ll, sizeof(adc_pkt[!current_buf]));