Files
@ afacd0c3c31c
Branch filter:
Location: protofuse-firmware/src/main.c - annotation
afacd0c3c31c
1.3 KiB
text/plain
Fix S file
ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d 47fdd16b7231 48ae84f03494 ec79a7a31ac7 ec79a7a31ac7 ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d 47fdd16b7231 47fdd16b7231 47fdd16b7231 ec79a7a31ac7 47fdd16b7231 47fdd16b7231 7e9d097bfe72 7e9d097bfe72 47fdd16b7231 ec79a7a31ac7 7e9d097bfe72 ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d 48ae84f03494 ad3725832a9d ad3725832a9d ad3725832a9d ec79a7a31ac7 ad3725832a9d 7e9d097bfe72 48ae84f03494 48ae84f03494 ec79a7a31ac7 7e9d097bfe72 ec79a7a31ac7 ec79a7a31ac7 7e9d097bfe72 ec79a7a31ac7 ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d ad3725832a9d | //
// STM32F103 Template Firmware
// Copyright 2016 SeaLandAire Technologies
// Author(s): Ethan Zonca
//
#include "stm32f3xx_hal.h"
#include "config.h"
#include "watchdog.h"
#include "system.h"
#include "gpio.h"
#include "error.h"
#include "flash.h"
#include "ssd1306.h"
#include "stdio.h"
#include "adc.h"
#include "dma.h"
int main(void)
{
sysclock_init();
hal_init();
gpio_init();
ssd1306_init();
ssd1306_drawlogo();
ssd1306_clearscreen();
adc_init();
// ssd1306_drawstring(const char *dataPtr, unsigned char row, unsigned char xPos)
ssd1306_drawstring("[ ProtoFuse ]", 0, 0);
ssd1306_drawstring("HW v1.0 SW v0.1", 1, 0);
uint16_t temp_counter = 0;
flash_init();
watchdog_init();
// Software timers
uint32_t last_blink_time = HAL_GetTick();
while (1)
{
// Grab and transmit data
if(HAL_GetTick() - last_blink_time > 100)
{
char buffer[256];
// added stdio.h to fix implicit declaration error
// changed battery_adc_count from int32_t to int
snprintf(buffer, 256, "Counter: %u", temp_counter);
ssd1306_drawstring(buffer, 2, 0);
snprintf(buffer, 256, "i count: %u", get_viout_counts());
ssd1306_drawstring(buffer, 3, 0);
// HAL_GPIO_TogglePin(LED_RED);
temp_counter++;
last_blink_time = HAL_GetTick();
}
watchdog_feed();
}
}
|