Move Intercom temp sensor initialisation from mendel.c to temp.c.

This commit is contained in:
Markus Hitter 2014-11-03 15:51:19 +01:00
parent a9f1d00865
commit f6115688c5
2 changed files with 12 additions and 14 deletions

View File

@ -186,14 +186,6 @@ void io_init(void) {
WRITE(MISO, 1); SET_INPUT(MISO); WRITE(MISO, 1); SET_INPUT(MISO);
#endif #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 #ifdef DEBUG_LED_PIN
WRITE(DEBUG_LED_PIN, 0); WRITE(DEBUG_LED_PIN, 0);
SET_OUTPUT(DEBUG_LED_PIN); SET_OUTPUT(DEBUG_LED_PIN);

18
temp.c
View File

@ -97,12 +97,18 @@ void temp_init() {
break;*/ break;*/
#endif #endif
#ifdef TEMP_INTERCOM #ifdef TEMP_INTERCOM
case TT_INTERCOM: case TT_INTERCOM:
intercom_init(); // Enable the RS485 transceiver
send_temperature(0, 0); SET_OUTPUT(RX_ENABLE_PIN);
break; SET_OUTPUT(TX_ENABLE_PIN);
#endif WRITE(RX_ENABLE_PIN,0);
disable_transmit();
intercom_init();
send_temperature(0, 0);
// Intentionally no break.
#endif
default: /* prevent compiler warning */ default: /* prevent compiler warning */
break; break;