Changeset - e9e09e0dbae7
[Not reviewed]
default
0 2 0
Ethan Zonca - 10 years ago 2014-09-11 22:22:54
ez@ethanzonca.com
Add actual SSR output support
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
config.h
Show inline comments
 
@@ -6,14 +6,16 @@
 

	
 
#define LED_POWER GPIOB,GPIO_Pin_9
 
#define LED_STAT  GPIOA,GPIO_Pin_15
 

	
 
#define MAX_CS GPIOB,GPIO_Pin_12
 

	
 
#define SW_BTN  GPIOB, GPIO_Pin_3
 
#define SW_UP   GPIOB, GPIO_Pin_4
 
#define SW_DOWN GPIOB, GPIO_Pin_6
 
#define SW_LEFT GPIOB, GPIO_Pin_5
 
#define SW_RIGHT GPIOB, GPIO_Pin_7
 

	
 
#define SSR_PIN GPIOC, GPIO_Pin_13
 

	
 

	
 
#endif
main.c
Show inline comments
 
@@ -251,32 +251,34 @@ 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);
 
 
            GPIO_SetBits(LED_STAT);
 
            GPIO_SetBits(SSR_PIN);
 
            last_ssr_on = ticks;
 
        }
 
    }
 
    
 
    // Kill SSR after elapsed period less than SSR_PERIOD 
 
    if(ticks - last_ssr_on > ssr_output)
 
    {
 
        GPIO_ResetBits(LED_STAT);
 
        GPIO_ResetBits(SSR_PIN);
 
    }
 
}
 
 
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);
 
    itoa(setpoint, tempstr);
 
    ssd1306_DrawString("    ", 3, 95);
 
    ssd1306_DrawString(tempstr, 3, 95);
0 comments (0 inline, 0 general)