[avr] add debugging to INT{0,1} ISRs

This commit is contained in:
Bart Van Der Meerssche 2011-01-25 20:51:08 +01:00
parent 33cffa6b79
commit 112661303d
1 changed files with 10 additions and 2 deletions

View File

@ -158,16 +158,24 @@ finish:
ISR(INT0_vect) ISR(INT0_vect)
{ {
DBG_ISR_BEGIN();
uint8_t muxn_l = phy_to_log[3]; uint8_t muxn_l = phy_to_log[3];
register_pulse(&sensor[muxn_l], &state[muxn_l]); register_pulse(&sensor[muxn_l], &state[muxn_l]);
DBG_ISR_END();
} }
ISR(INT1_vect) ISR(INT1_vect)
{ {
DBG_ISR_BEGIN();
uint8_t muxn_l = phy_to_log[4]; uint8_t muxn_l = phy_to_log[4];
register_pulse(&sensor[muxn_l], &state[muxn_l]); register_pulse(&sensor[muxn_l], &state[muxn_l]);
DBG_ISR_END();
} }
void register_pulse(volatile struct sensor_struct *psensor, volatile struct state_struct *pstate) void register_pulse(volatile struct sensor_struct *psensor, volatile struct state_struct *pstate)
@ -179,10 +187,10 @@ void register_pulse(volatile struct sensor_struct *psensor, volatile struct stat
ISR(TIMER1_COMPA_vect) ISR(TIMER1_COMPA_vect)
{ {
uint8_t muxn_l = phy_to_log[muxn];
DBG_ISR_BEGIN(); DBG_ISR_BEGIN();
uint8_t muxn_l = phy_to_log[muxn];
MacU16X16to32(state[muxn_l].nano, sensor[muxn_l].meterconst, ADC); MacU16X16to32(state[muxn_l].nano, sensor[muxn_l].meterconst, ADC);
if (state[muxn_l].nano > WATT) { if (state[muxn_l].nano > WATT) {