Changeset - d4552b17855a
[Not reviewed]
cortex-f0
0 7 0
matthewreed - 9 years ago 2015-12-23 16:09:55

Resolved all compiler warnings
7 files changed with 34 insertions and 28 deletions:
0 comments (0 inline, 0 general)
display.c
Show inline comments
 
#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
display.h
Show inline comments
 
#ifndef DISPLAY_H
 
#define DISPLAY_H
 

	
 
#include <stdlib.h>
 
#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);
 

	
gpio.c
Show inline comments
 
#include "gpio.h"
 
#include "config.h"
 
#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;
gpio.h
Show inline comments
 
@@ -2,6 +2,9 @@
 
#define GPIO_H
 

	
 
#include <inttypes.h>
 
#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
main.c
Show inline comments
 
@@ -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"
ssd1306.c
Show inline comments
 
@@ -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
ssd1306.h
Show inline comments
 
@@ -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) 
0 comments (0 inline, 0 general)