summaryrefslogtreecommitdiff
path: root/gm_platform/fw/adc.c
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-04-01 14:45:11 +0200
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-04-01 14:45:11 +0200
commita803d10b035865ef3049168777d1069b5e1917f4 (patch)
tree5f21000d2974a78fd5f9d12104c67c6319a55190 /gm_platform/fw/adc.c
parent3beecbc4fa60773ffbdf04ce1908a86be5908551 (diff)
downloadmaster-thesis-a803d10b035865ef3049168777d1069b5e1917f4.tar.gz
master-thesis-a803d10b035865ef3049168777d1069b5e1917f4.tar.bz2
master-thesis-a803d10b035865ef3049168777d1069b5e1917f4.zip
gm_platform: Add support for OCXO and GPS sync
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]));