#include "stm32f0xx_hal.h"
#include "ssd1306.h"
#include "stringhelpers.h"
#include "display.h"
#include "config.h"
#include "states.h"
#include "syslib.h"
#include "flash.h"
#include "gpio.h"
#ifdef MAX31865_RTD_SENSOR
#include "max31865.h"
#endif
// Private function prototypes
static void draw_setpoint(therm_status_t* status);
@@ -159,7 +149,7 @@ void display_process(therm_settings_t* s
status->state = STATE_SETI;
}
else {
user_input(&set->val.k_p);
user_input((uint16_t*)&set->val.k_p);
// Event Handler
@@ -188,7 +178,7 @@ void display_process(therm_settings_t* s
status->state = STATE_SETD;
user_input(&set->val.k_i);
user_input((uint16_t*)&set->val.k_i);
@@ -217,7 +207,7 @@ void display_process(therm_settings_t* s
status->state = STATE_SETWINDUP;
user_input(&set->val.k_d);
user_input((uint16_t*)&set->val.k_d);
@@ -246,7 +236,7 @@ void display_process(therm_settings_t* s
status->state = STATE_SETBOOTTOBREW;
user_input(&set->val.windup_guard);
user_input((uint16_t*)&set->val.windup_guard);
@@ -341,7 +331,7 @@ void display_process(therm_settings_t* s
status->state = STATE_IDLE;
user_input_signed(&set->val.temp_offset);
user_input_signed((int16_t*)(&set->val.temp_offset));
@@ -367,7 +357,7 @@ void display_process(therm_settings_t* s
user_input(&set->val.setpoint_brew);
user_input((uint16_t*)&set->val.setpoint_brew);
@@ -393,7 +383,7 @@ void display_process(therm_settings_t* s
#ifndef DISPLAY_H
#define DISPLAY_H
#include <stdlib.h>
void display_process(therm_settings_t* set, therm_status_t* status);
#include "stm32f0xx_hal_conf.h"
#include <inttypes.h>
// Increase on each press, and increase at a fast rate after duration elapsed of continuously holding down... somehow...
static uint32_t change_time_reset = 0;
@@ -2,6 +2,9 @@
#define GPIO_H
#define CHANGE_PERIOD_MS 100
#define CHANGE_ELAPSED (HAL_GetTick() - change_time_reset) > CHANGE_PERIOD_MS
@@ -5,8 +5,12 @@
#include "pid.h"
#ifdef MAX31855_TC_SENSOR
#include "max31855.h"
#include "spi.h"
@@ -260,15 +260,14 @@ void ssd1306_drawlogo()
/* Print a single character from font.cpp */
void ssd1306_drawchar(char ascii, unsigned char row, unsigned char xPos)
{
char *srcPointer = -1;
unsigned char i;
const char *srcPointer = (char*)-1;
srcPointer = &fontData[(ascii-32)][0];
setStartPage(row);
setStartColumn(xPos);
for(i=0;i<5;i++)
for(uint8_t i = 0; i < 5; i++)
WriteData(*srcPointer);
srcPointer++;
@@ -278,8 +277,7 @@ void ssd1306_drawchar(char ascii, unsign
void ssd1306_drawcharbig(char ascii, unsigned char row, unsigned char xPos)
@@ -287,7 +285,7 @@ void ssd1306_drawcharbig(char ascii, uns
// Write first row
uint8_t data = 0;
data |= ((*srcPointer) & 0b1000) << 4; // get top 4 bits
@@ -315,7 +313,7 @@ void ssd1306_drawcharbig(char ascii, uns
// Write second row
data |= (*srcPointer) & 0b10000000; // get top 4 bits
@@ -12,6 +12,8 @@
#define SSD_CS_Low() HAL_GPIO_WritePin(SSD_CS, 0)
#define SSD_CS_High() HAL_GPIO_WritePin(SSD_CS, 1)
// EMZ FIXME this won't really work
#define SPI_SendByte(data) HAL_SPI_Transmit(spi_get(), &data, 1, 100)
//#define SPI_SendByte(data)
Status change: