fix output

This commit is contained in:
Olaf Rempel 2011-04-17 15:15:49 +02:00
parent ae7bcc5136
commit 4e1d77b4b1

8
main.c
View File

@ -32,7 +32,7 @@
* OUTPUT (active low) on PB0 * OUTPUT (active low) on PB0
*/ */
/* RC5 bitlength is 1778us +/-10% convert to time0 ticks (8us) */ /* RC5 bitlength is 1778us +/-10% convert to timer0 ticks (8us) */
#define BITWIDTH (1778 / 8) #define BITWIDTH (1778 / 8)
#define BITWIDTH_MIN (BITWIDTH - (BITWIDTH / 10)) #define BITWIDTH_MIN (BITWIDTH - (BITWIDTH / 10))
#define BITWIDTH_MAX (BITWIDTH + (BITWIDTH / 10)) #define BITWIDTH_MAX (BITWIDTH + (BITWIDTH / 10))
@ -42,8 +42,8 @@
#define RC5_COMPLETE 0x8000 #define RC5_COMPLETE 0x8000
#define PROGMODE_CHECK() (!(PINB & (1<<PINB1))) #define PROGMODE_CHECK() (!(PINB & (1<<PINB1)))
#define OUTPUT_ON() { PORTA &= ~(1<<PORTA0); } #define OUTPUT_ON() { PORTB &= ~(1<<PORTB0); }
#define OUTPUT_OFF() { PORTA |= (1<<PORTA0); } #define OUTPUT_OFF() { PORTB |= (1<<PORTB0); }
struct ee_param { struct ee_param {
uint16_t rc5cmd; uint16_t rc5cmd;
@ -103,6 +103,8 @@ ISR(TIM0_COMPB_vect)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
DDRB = (1<<PORTB0);
/* pullup on RC5IN and PROGMEM, OUTPUT is low active */ /* pullup on RC5IN and PROGMEM, OUTPUT is low active */
PORTB = (1<<PORTB2) | (1<<PORTB1) | (1<<PORTB0); PORTB = (1<<PORTB2) | (1<<PORTB1) | (1<<PORTB0);