|
|
|
|
@ -155,14 +155,17 @@ int main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ioHelperSetBit(outStatesBlinking, LED_PLC_OK, 1);
|
|
|
|
|
//ioHelperSetBit(outStatesBlinking, OUT_VENTIL_ABLASS, 1);
|
|
|
|
|
//ioHelperSetBit(outStatesBlinking, OUT_VENTIL_PUMPE, 1);
|
|
|
|
|
|
|
|
|
|
ioHelperSetBit(outStates, OUT_PUMPE_STARTSTOP, 1);
|
|
|
|
|
ioHelperSetBit(outStates, OUT_PUMPE_PWM, 1);
|
|
|
|
|
|
|
|
|
|
uint32_t timer_blink_outs = millis();
|
|
|
|
|
uint32_t timer_send_uptime = millis();
|
|
|
|
|
uint32_t timer_send_temps = millis();
|
|
|
|
|
|
|
|
|
|
printf("anlage: %x\n\r", read_Input(IN_ANLAGE_EIN_INV, LEVEL));
|
|
|
|
|
send_value(&mqtt_client, "/Filamentanlage/02_Wasserbecken/connected", 1);
|
|
|
|
|
send_value(&mqtt_client, "/Filamentanlage/02_Wasserbecken/state/pumpe_warm", -1);
|
|
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
@ -174,6 +177,7 @@ int main()
|
|
|
|
|
|
|
|
|
|
// Toggle all outs which are set to blinking
|
|
|
|
|
if(millis() - timer_blink_outs > 500){
|
|
|
|
|
timer_blink_outs = millis();
|
|
|
|
|
outStates[0] ^= outStatesBlinking[0];
|
|
|
|
|
outStates[1] ^= outStatesBlinking[1];
|
|
|
|
|
outStates[2] ^= outStatesBlinking[2];
|
|
|
|
|
@ -203,14 +207,6 @@ int main()
|
|
|
|
|
send_value(&mqtt_client, "/Filamentanlage/02_Wasserbecken/uptime", millis()/1000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(read_Input(IN_ANLAGE_EIN_INV, FALLING)){
|
|
|
|
|
printf("anlage ein\n\r");
|
|
|
|
|
}
|
|
|
|
|
// ioHelperSetBit(outStates, LED_GRN_NOTAUS_SCHRANK, 1);
|
|
|
|
|
//}
|
|
|
|
|
//else{
|
|
|
|
|
// ioHelperSetBit(outStates, LED_GRN_NOTAUS_SCHRANK, 0);
|
|
|
|
|
//}
|
|
|
|
|
do_notaus();
|
|
|
|
|
|
|
|
|
|
#if PLC_MQTT_ENABLED
|
|
|
|
|
@ -239,7 +235,7 @@ static void avr_init(void)
|
|
|
|
|
{
|
|
|
|
|
// Initialize device here.
|
|
|
|
|
// WatchDog INIT
|
|
|
|
|
wdt_enable(WDTO_8S); // set up wdt reset interval 2 second
|
|
|
|
|
wdt_enable(WDTO_2S); // set up wdt reset interval 2 second
|
|
|
|
|
wdt_reset(); // wdt reset ~ every <2000ms
|
|
|
|
|
|
|
|
|
|
timer0_init();// Timer0 millis engine init
|
|
|
|
|
|