Rev 1753 | Rev 1828 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1753 | Rev 1755 | ||
|---|---|---|---|
| Line 10... | Line 10... | ||
| 10 | /*----------------------------------------------------------------------------- |
10 | /*----------------------------------------------------------------------------- |
| 11 | * Includes |
11 | * Includes |
| 12 | *---------------------------------------------------------------------------*/ |
12 | *---------------------------------------------------------------------------*/ |
| 13 | #include <config.h> |
13 | #include <config.h> |
| 14 | #include <drivers/mcu/pcint.h> |
14 | #include <drivers/mcu/pcint.h> |
| 15 | #include <drivers/mcu/gpio.h> |
- | |
| 16 | #include <drivers/ir/transceiver/irtransceiverMulti.h> |
15 | #include <drivers/ir/transceiver/irtransceiverMulti.h> |
| 17 | #include <drivers/ir/protocols.h> |
16 | #include <drivers/ir/protocols.h> |
| 18 | #include <avr/io.h> |
17 | #include <avr/io.h> |
| 19 | #include <avr/interrupt.h> |
18 | #include <avr/interrupt.h> |
| 20 | 19 | ||
| Line 166... | Line 165... | ||
| 166 | 165 | ||
| 167 | #if IR_RX_ENABLE==1 |
166 | #if IR_RX_ENABLE==1 |
| 168 | /* When this timeout occurs a pulsetrain is complete */ |
167 | /* When this timeout occurs a pulsetrain is complete */ |
| 169 | ISR(IR_TIMEOUT_VECTOR) |
168 | ISR(IR_TIMEOUT_VECTOR) |
| 170 | { |
169 | { |
| 171 | gpio_toggle_pin(GPIO_B0); /* Toggle debug output PB0 */ |
- | |
| 172 | for (uint8_t i=0; i < 3; i++) |
170 | for (uint8_t i=0; i < 3; i++) |
| 173 | { |
171 | { |
| 174 | /* If more than 3 flanks was recevied */ |
172 | /* If more than 3 flanks was recevied */ |
| 175 | if (drvIrRxChannel[i].storeEnable == TRUE && drvIrRxChannel[i].rxlen > 3) |
173 | if (drvIrRxChannel[i].storeEnable == TRUE && drvIrRxChannel[i].rxlen > 3) |
| 176 | { |
174 | { |
| Line 207... | Line 205... | ||
| 207 | IrTransceiver_Store(2); |
205 | IrTransceiver_Store(2); |
| 208 | } |
206 | } |
| 209 | 207 | ||
| 210 | void IrTransceiver_Store(uint8_t channel) |
208 | void IrTransceiver_Store(uint8_t channel) |
| 211 | { |
209 | { |
| 212 | gpio_toggle_pin(GPIO_B7); /* Toggle debug output PB7 */ |
- | |
| 213 | //gpio_toggle_pin(GPIO_D7); /* Toggle debug output PD7 */ |
- | |
| 214 | - | ||
| 215 | static uint16_t prev_time[3]; |
210 | static uint16_t prev_time[3]; |
| 216 | uint16_t pulsewidth; |
211 | uint16_t pulsewidth; |
| 217 | 212 | ||
| 218 | /* Read the timer counter register to get the current "time". */ |
213 | /* Read the timer counter register to get the current "time". */ |
| 219 | uint16_t time = IR_COUNT_REG; |
214 | uint16_t time = IR_COUNT_REG; |