Skip to content

Commit

Permalink
Merge branch 'master' into v2.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
miceuz committed Oct 26, 2015
2 parents e7ada2b + b112bca commit cebf38c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ static inline loopSensorMode() {
twiTransmitByte(currCapacitance >> 8);
twiTransmitByte(currCapacitance &0x00FF);
currCapacitance = getCapacitance();
set_sleep_mode(SLEEP_MODE_PWR_SAVE);
sleep_mode();
} else if(TWI_SET_ADDRESS == usiRx) {
uint8_t newAddress = twiReceiveByte();
if(twiIsValidAddress(newAddress)) {
Expand All @@ -197,16 +199,22 @@ static inline loopSensorMode() {

GIMSK |= _BV(PCIE0);
TCCR1B = _BV(CS10) | _BV(CS11); //start timer1 with prescaler clk/64
set_sleep_mode(SLEEP_MODE_PWR_SAVE);
sleep_mode();

} else if(TWI_GET_TEMPERATURE == usiRx) {
twiTransmitByte(temperature >> 8);
twiTransmitByte(temperature & 0x00FF);
temperature = getTemperature();
set_sleep_mode(SLEEP_MODE_PWR_SAVE);
sleep_mode();
} else if(TWI_RESET == usiRx) {
reset();

} else if(TWI_GET_VERSION == usiRx) {
twiTransmitByte(FIRMWARE_VERSION);
set_sleep_mode(SLEEP_MODE_PWR_SAVE);
sleep_mode();
}
}
}
Expand Down

0 comments on commit cebf38c

Please sign in to comment.