Files
@ e8e5873934fa
Branch filter:
Location: windsonde/Source/main.c - annotation
e8e5873934fa
2.0 KiB
text/plain
Move power to config.h
02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 02d3447dac18 0f04af7169be 0f04af7169be 0f04af7169be 55ef914749dc 55ef914749dc 02d3447dac18 02d3447dac18 0f04af7169be 0f04af7169be 0f04af7169be 7ff1c5a59571 67d1f9d02048 02d3447dac18 0f04af7169be 0f04af7169be 0f04af7169be 7ff1c5a59571 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 67d1f9d02048 0f04af7169be 0f04af7169be 041562172b4a 7ff1c5a59571 55ef914749dc 55ef914749dc 0f04af7169be 0592d2a3ee8b 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0592d2a3ee8b 0f04af7169be 0592d2a3ee8b 55ef914749dc 55ef914749dc c52174ca9326 0f04af7169be 0f04af7169be 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0592d2a3ee8b 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 0f04af7169be 2ee6c8e67f32 0f04af7169be 0f04af7169be 0f04af7169be 2ee6c8e67f32 2ee6c8e67f32 | /*
* FeatherHAB
*
* This file is part of FeatherHAB.
*
* FeatherHab is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FeatherHab is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with FeatherHAB. If not, see <http://www.gnu.org/licenses/>.
*
* Ethan Zonca
*
*/
#include "stm32f0xx_hal.h"
#include "config.h"
#include "error.h"
//#include "pressure.h"
#include "bme280.h"
#include "gps.h"
#include "system/gpio.h"
#include "system/sysclk.h"
#include "system/watchdog.h"
#include "system/uart.h"
#include "system/adc.h"
#include "si446x/si446x.h"
#include "aprs/aprs.h"
#include "aprs/afsk.h"
int main(void)
{
hal_init();
sysclock_init();
gpio_init();
adc_init();
afsk_init();
si446x_init();
si446x_init();
gps_poweron();
// pressure_init();
bme280_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();
bme280_update();
while(afsk_busy()); // ensure previous message finished
aprs_send();
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();
}
}
// vim:softtabstop=4 shiftwidth=4 expandtab
|