Files
@ 041562172b4a
Branch filter:
Location: windsonde/Source/main.c - annotation
041562172b4a
1.3 KiB
text/plain
Doubleinit radio for guaranteed init; GPS fixes
0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 7ff1c5a59571 67d1f9d02048 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 34a13647cf13 7ff1c5a59571 7ff1c5a59571 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 041562172b4a 041562172b4a 67d1f9d02048 7ff1c5a59571 0f04af7169be 0f04af7169be 041562172b4a 041562172b4a 041562172b4a 041562172b4a 7ff1c5a59571 041562172b4a 041562172b4a 34a13647cf13 7ff1c5a59571 0f04af7169be 0592d2a3ee8b 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0592d2a3ee8b 0f04af7169be 0592d2a3ee8b 34a13647cf13 0f04af7169be 0592d2a3ee8b 0f04af7169be 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be | //
// mBuoy Depth Select Firmware
// Copyright 2015 SeaLandAire Technologies
//
#include "config.h"
#include "error.h"
#include "system/gpio.h"
#include "system/sysclk.h"
#include "system/watchdog.h"
#include "system/uart.h"
#include "system/adc.h"
#include "stm32f0xx_hal.h"
#include "si446x/si446x.h"
#include "aprs/aprs.h"
#include "aprs/afsk.h"
#include "pressure.h"
#include "gps.h"
int main(void)
{
hal_init();
sysclock_init();
gpio_init();
HAL_Delay(100);
adc_init();
afsk_init();
si446x_init();
si446x_init();
HAL_Delay(100);
gps_poweron();
HAL_Delay(100);
pressure_init();
// Software timers
uint32_t last_transmission = HAL_GetTick();
uint32_t last_led = HAL_GetTick();
while (1)
{
// Blink LEDs
if(HAL_GetTick() - last_transmission > 700)
{
gps_update_data(); // Will always return at 1hz rate (default measurement rate)
pressure_read();
aprs_send();
//while(afsk_busy());
last_transmission = HAL_GetTick();
}
if(HAL_GetTick() - last_led > 100)
{
HAL_GPIO_TogglePin(LED_POWER);
last_led = HAL_GetTick();
}
if(afsk_request_cwoff())
si446x_cw_off();
// High-frequency function calls
// watchdog_feed();
}
}
|