Changeset - 39ea1ee3d5af
[Not reviewed]
default
0 1 0
Ethan Zonca - 8 years ago 2017-06-22 22:32:10
ez@ethanzonca.com
Add logo rendering
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/main.c
Show inline comments
 
@@ -2,66 +2,66 @@
 
// Therm Firmware
 
// Copyright 2017 Ethan Zonca
 
// 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 "dma.h"
 
#include "interrupts.h"
 
#include "buttons.h"
 
 
int main(void)
 
{
 
	sysclock_init();
 
	hal_init();
 
	gpio_init();
 
	ssd1306_init();
 
	ssd1306_clearscreen();
 
	ssd1306_drawlogo();
 
	ssd1306_clearscreen();
 
 
	HAL_Delay(2000);
 
	flash_init();
 
	watchdog_init();
 
 
	//just some example code for getting flash values
 
//	flash_getsettings()->values.can_id = 67;
 
//
 
//	if(flash_getsettings()->values.can_id == 12);
 
 
//	ssd1306_drawstring(const char *dataPtr, unsigned char row, unsigned char xPos)
 
//	ssd1306_drawstring("[ ProtoFuse ]", 0, 0);
 
 
	float temp_counter = 0;
 
 
	// Software timers
 
	uint32_t last_screen_update_time = HAL_GetTick();
 
 
 
	while (1)
 
	{
 
		// function that checks all the buttons
 
		freaking_debounce();
 
 
		// Grab and transmit data
 
		if(HAL_GetTick() - last_screen_update_time > 100)
 
		{
 
			HAL_GPIO_TogglePin(LED_GPIO_Port, LED_PIN);
 
			char buffer[256];
 
			snprintf(buffer, 256, "Counter: %.1f", temp_counter);
 
			ssd1306_drawstring(buffer, 3, 10);
 
			ssd1306_drawstring("Therm Next Generation", 0, 0);
 
			ssd1306_drawstring(buffer, 3, 45);
 
			ssd1306_drawstring("Therm 0.4", 0, 40);
 
			temp_counter = temp_counter + 0.1;
 
			last_screen_update_time = HAL_GetTick();
 
		}
 
 
		watchdog_feed();
 
	}
 
}
 
 
0 comments (0 inline, 0 general)