Browse Source

fix output

master
Olaf Rempel 10 years ago
parent
commit
4e1d77b4b1
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      main.c

+ 5
- 3
main.c View File

@ -32,7 +32,7 @@
* 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_MIN (BITWIDTH - (BITWIDTH / 10))
#define BITWIDTH_MAX (BITWIDTH + (BITWIDTH / 10))
@ -42,8 +42,8 @@
#define RC5_COMPLETE 0x8000
#define PROGMODE_CHECK() (!(PINB & (1<<PINB1)))
#define OUTPUT_ON() { PORTA &= ~(1<<PORTA0); }
#define OUTPUT_OFF() { PORTA |= (1<<PORTA0); }
#define OUTPUT_ON() { PORTB &= ~(1<<PORTB0); }
#define OUTPUT_OFF() { PORTB |= (1<<PORTB0); }
struct ee_param {
uint16_t rc5cmd;
@ -103,6 +103,8 @@ ISR(TIM0_COMPB_vect)
int main(int argc, char *argv[])
{
DDRB = (1<<PORTB0);
/* pullup on RC5IN and PROGMEM, OUTPUT is low active */
PORTB = (1<<PORTB2) | (1<<PORTB1) | (1<<PORTB0);


Loading…
Cancel
Save