Changeset - fe0367a9a87a
[Not reviewed]
default
0 1 0
Ethan Zonca - 10 years ago 2014-10-18 17:33:12
ez@ethanzonca.com
Added larger font size and removed logos on preheat/etc screens
1 file changed with 16 insertions and 18 deletions:
main.c
16
18
0 comments (0 inline, 0 general)
main.c
Show inline comments
 
@@ -89,14 +89,15 @@ int main(void)
 
    ssd1306_Init();
 
    ssd1306_clearscreen();
 
 
    // Check for problems on startup
 
    if(clock_fail) {
 
        //ssd1306_DrawStringBig("ERROR: Check Xtal", 2, 0);
 
        ssd1306_DrawStringBig("XTAL ERR", 2, 0);
 
        delay(5000);
 
        ssd1306_DrawStringBig("NO XTAL", 2, 0);
 
        delay(1000);
 
        ssd1306_clearscreen();
 
    }
 
 
    // Init USB
 
    //Set_System(); // hw_config.h
 
    Set_USBClock();
 
    USB_Interrupts_Config();
 
@@ -261,15 +262,13 @@ void process()
 
 
        // Only support heating (ssr_output > 0) right now
 
        if(ssr_output > 0) {
 
 
            char tempstr[6];
 
            itoa(ssr_output, tempstr);
 
            ssd1306_DrawString("#=", 2, 45);
 
            ssd1306_DrawString("    ", 2, 57);
 
            ssd1306_DrawString(tempstr, 2, 57);
 
            ssd1306_DrawString(tempstr, 0, 90);
 
 
            GPIO_SetBits(LED_STAT);
 
            GPIO_SetBits(SSR_PIN);
 
            last_ssr_on = ticks;
 
        }
 
    }
 
@@ -282,18 +281,17 @@ void process()
 
    }
 
}
 
 
void draw_setpoint() {
 
    char tempstr[3];
 
    itoa_fp(temp, temp_frac, tempstr);
 
    //ssd1306_DrawString("        ", 3, 40);
 
    ssd1306_DrawString(tempstr, 3, 40);
 
    ssd1306_DrawString("-> ", 3, 80);
 
    ssd1306_DrawStringBig(tempstr, 3, 0);
 
    ssd1306_DrawStringBig(">", 3, 74);
 
    itoa(setpoint, tempstr);
 
    ssd1306_DrawString("    ", 3, 95);
 
    ssd1306_DrawString(tempstr, 3, 95);
 
    ssd1306_DrawStringBig("    ", 3, 90);
 
    ssd1306_DrawStringBig(tempstr, 3, 90);
 
}
 
 
uint8_t goto_mode = 2;
 
 
// State machine
 
uint8_t sw_btn_last = 0;
 
@@ -591,14 +589,14 @@ void machine()
 
 
        case STATE_PREHEAT_BREW:
 
        {
 
            // Write text to OLED
 
            // [ therm : preheating brew ]
 
            // [ 30 => 120 C             ]
 
            ssd1306_DrawString("Preheating...", 0, 40);
 
            ssd1306_drawlogo();
 
            ssd1306_DrawString("Preheating...", 0, 0);
 
            //ssd1306_drawlogo();
 
            draw_setpoint();
 
            pid_enabled = 1;
 
	    setpoint = setpoint_brew;
 
 
            // Button handler
 
            if(SW_BTN_PRESSED) {
 
@@ -618,14 +616,14 @@ void machine()
 
 
        case STATE_MAINTAIN_BREW:
 
        {
 
            // Write text to OLED
 
            // [ therm : ready to brew ]
 
            // [ 30 => 120 C           ]
 
            ssd1306_DrawString("Ready to Brew!", 0, 40);
 
            ssd1306_drawlogo();
 
            ssd1306_DrawString("Preheated!", 0, 0);
 
            //ssd1306_drawlogo();
 
            draw_setpoint();
 
            pid_enabled = 1;
 
	    setpoint = setpoint_brew;
 
 
            // Button handler
 
            if(SW_BTN_PRESSED) {
 
@@ -643,14 +641,14 @@ void machine()
 
 
        case STATE_PREHEAT_STEAM:
 
        {
 
            // Write text to OLED
 
            // [ therm : preheating steam ]
 
            // [ 30 => 120 C           ]
 
            ssd1306_DrawString("Preheating...", 0, 40);
 
            ssd1306_drawlogo();
 
            ssd1306_DrawString("Preheating...", 0, 0);
 
            //ssd1306_drawlogo();
 
            draw_setpoint();
 
            pid_enabled = 1;
 
	    setpoint = setpoint_steam;
 
	    
 
            // Button handler
 
            if(SW_BTN_PRESSED) {
 
@@ -670,14 +668,14 @@ void machine()
 
 
        case STATE_MAINTAIN_STEAM:
 
        {
 
            // Write text to OLED
 
            // [ therm : ready to steam ]
 
            // [ 30 => 120 C            ]
 
            ssd1306_DrawString("Ready to Steam!", 0, 40);
 
            ssd1306_drawlogo();
 
            ssd1306_DrawString("Ready to Steam!", 0, 0);
 
            //ssd1306_drawlogo();
 
            draw_setpoint();
 
            pid_enabled = 1;
 
	    setpoint = setpoint_steam;
 
 
            // Button handler
 
            if(SW_BTN_PRESSED) {
0 comments (0 inline, 0 general)