diff --git a/mendel.c b/mendel.c index 7123c75..dd9a99c 100644 --- a/mendel.c +++ b/mendel.c @@ -186,14 +186,6 @@ void io_init(void) { WRITE(MISO, 1); SET_INPUT(MISO); #endif - #ifdef TEMP_INTERCOM - // Enable the RS485 transceiver - SET_OUTPUT(RX_ENABLE_PIN); - SET_OUTPUT(TX_ENABLE_PIN); - WRITE(RX_ENABLE_PIN,0); - disable_transmit(); - #endif - #ifdef DEBUG_LED_PIN WRITE(DEBUG_LED_PIN, 0); SET_OUTPUT(DEBUG_LED_PIN); diff --git a/temp.c b/temp.c index bd9f9d4..dd4253c 100644 --- a/temp.c +++ b/temp.c @@ -97,12 +97,18 @@ void temp_init() { break;*/ #endif - #ifdef TEMP_INTERCOM - case TT_INTERCOM: - intercom_init(); - send_temperature(0, 0); - break; - #endif + #ifdef TEMP_INTERCOM + case TT_INTERCOM: + // Enable the RS485 transceiver + SET_OUTPUT(RX_ENABLE_PIN); + SET_OUTPUT(TX_ENABLE_PIN); + WRITE(RX_ENABLE_PIN,0); + disable_transmit(); + + intercom_init(); + send_temperature(0, 0); + // Intentionally no break. + #endif default: /* prevent compiler warning */ break;