# HG changeset patch # User matthewreed # Date 2015-12-23 16:09:55 # Node ID d4552b17855a90a2aed47bcc3e81ba282564f802 # Parent 45ee045c249f9b209b70638e4fd1ce931fc3dff0 Resolved all compiler warnings diff --git a/display.c b/display.c --- a/display.c +++ b/display.c @@ -1,15 +1,5 @@ -#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; } else { - user_input(&set->val.k_i); + user_input((uint16_t*)&set->val.k_i); } // Event Handler @@ -217,7 +207,7 @@ void display_process(therm_settings_t* s status->state = STATE_SETWINDUP; } else { - user_input(&set->val.k_d); + user_input((uint16_t*)&set->val.k_d); } // Event Handler @@ -246,7 +236,7 @@ void display_process(therm_settings_t* s status->state = STATE_SETBOOTTOBREW; } else { - user_input(&set->val.windup_guard); + user_input((uint16_t*)&set->val.windup_guard); } // Event Handler @@ -341,7 +331,7 @@ void display_process(therm_settings_t* s status->state = STATE_IDLE; } else { - user_input_signed(&set->val.temp_offset); + user_input_signed((int16_t*)(&set->val.temp_offset)); } // Event Handler @@ -367,7 +357,7 @@ void display_process(therm_settings_t* s status->state = STATE_IDLE; } else { - user_input(&set->val.setpoint_brew); + user_input((uint16_t*)&set->val.setpoint_brew); } // Event Handler @@ -393,7 +383,7 @@ void display_process(therm_settings_t* s status->state = STATE_IDLE; } else { - user_input(&set->val.setpoint_brew); + user_input((uint16_t*)&set->val.setpoint_brew); } // Event Handler diff --git a/display.h b/display.h --- a/display.h +++ b/display.h @@ -1,7 +1,19 @@ #ifndef DISPLAY_H #define DISPLAY_H +#include +#include "stm32f0xx_hal.h" #include "states.h" +#include "ssd1306.h" +#include "stringhelpers.h" +#include "config.h" +#include "states.h" +#include "syslib.h" +#include "flash.h" +#include "gpio.h" +#ifdef MAX31865_RTD_SENSOR +#include "max31865.h" +#endif void display_process(therm_settings_t* set, therm_status_t* status); diff --git a/gpio.c b/gpio.c --- a/gpio.c +++ b/gpio.c @@ -1,7 +1,4 @@ #include "gpio.h" -#include "config.h" -#include "stm32f0xx_hal_conf.h" -#include // 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; diff --git a/gpio.h b/gpio.h --- a/gpio.h +++ b/gpio.h @@ -2,6 +2,9 @@ #define GPIO_H #include +#include "stm32f0xx_hal.h" +#include "stm32f0xx_hal_conf.h" +#include "config.h" #define CHANGE_PERIOD_MS 100 #define CHANGE_ELAPSED (HAL_GetTick() - change_time_reset) > CHANGE_PERIOD_MS diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -5,8 +5,12 @@ #include "pid.h" #include "states.h" #include "ssd1306.h" +#ifdef MAX31855_TC_SENSOR #include "max31855.h" +#endif +#ifdef MAX31865_RTD_SENSOR #include "max31865.h" +#endif #include "gpio.h" #include "spi.h" #include "flash.h" diff --git a/ssd1306.c b/ssd1306.c --- a/ssd1306.c +++ b/ssd1306.c @@ -250,7 +250,7 @@ void ssd1306_drawlogo() setStartPage(0); setStartColumn(0); - for(i = 0; i<32; i++) + for(i = 0; i < 32; i++) { WriteData(row[3][i]); } @@ -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) { - char *srcPointer = -1; - unsigned char i; + const char *srcPointer = (char*)-1; srcPointer = &fontData[(ascii-32)][0]; @@ -287,7 +285,7 @@ void ssd1306_drawcharbig(char ascii, uns setStartColumn(xPos); // Write first row - for(i=0;i<5;i++) + for(uint8_t i = 0; i < 5; i++) { uint8_t data = 0; data |= ((*srcPointer) & 0b1000) << 4; // get top 4 bits @@ -315,7 +313,7 @@ void ssd1306_drawcharbig(char ascii, uns setStartColumn(xPos); // Write second row - for(i=0;i<5;i++) + for(uint8_t i = 0; i < 5; i++) { uint8_t data = 0; data |= (*srcPointer) & 0b10000000; // get top 4 bits diff --git a/ssd1306.h b/ssd1306.h --- a/ssd1306.h +++ b/ssd1306.h @@ -12,6 +12,8 @@ #define SSD_CS_Low() HAL_GPIO_WritePin(SSD_CS, 0) #define SSD_CS_High() HAL_GPIO_WritePin(SSD_CS, 1) +#include "spi.h" + // EMZ FIXME this won't really work #define SPI_SendByte(data) HAL_SPI_Transmit(spi_get(), &data, 1, 100) //#define SPI_SendByte(data)