* When in forced heater mode, the heater is controlled to heat at FORCED_MODE_VALUE which
* is between 0 and 100.
*/
-#define FORCE_HEATER_TEMP 28
-#define TARGET_FORCED_HEATER_TEMP 32
+#define FORCE_HEATER_TEMP 35
+#define MAX_HEATER_TEMP 90
+#define TARGET_FORCED_HEATER_TEMP 50
#define FORCED_MODE_VALUE 75 /* A fraction of 100 */
/* mA prod value above which the system will not enter forced mode, waiting for home
* to stop using power to start automatic heating */
};
/* Oldest acceptable time in RTC. BCD coded. */
const struct rtc_time oldest = {
- .year = 0x16,
- .month = 0x12,
- .day = 0x01,
- .hour = 0x13,
- .min = 0x37,
+ .year = 0x18,
+ .month = 0x09,
+ .day = 0x08,
+ .hour = 0x18,
+ .min = 0x00,
};
static struct rtc_time now;
ac_ctrl_state = 1;
}
-static uint8_t thermal_warn_flag = 0;
-void th_warning(uint32_t gpio)
-{
- /* FIXME : test for condition set or removed */
- /* Turn off AC output */
- gpio_clear(ac_ctrl);
- act_cmd = 0;
- thermal_warn_flag = 1;
- /* Turn on Fan at max speed */
- timer_set_match(LPC_TIMER_32B0, CHAN0, 0);
-}
-
/***************************************************************************** */
/* Zero cross and alert pin */
set_gpio_callback(zero_cross, &zero_cross_in_pin, EDGE_FALLING);
- set_gpio_callback(th_warning, &th_warn_in_pin, EDGES_BOTH);
/* Start ADC sampling */
adc_start_burst_conversion(ADC_MCH(0) | ADC_MCH(1) | ADC_MCH(2) | ADC_MCH(7), LPC_ADC_SEQ(0));
}
/* Set Control Output duty cycle */
+ if (water_centi_degrees > (MAX_HEATER_TEMP * 100)) {
+ command_val = 0;
+ }
+
set_ctrl_duty_cycle(command_val);
/* Debug Nath TMP */
//set_ctrl_duty_cycle( user_potar / 10 );