Taki jest komunikat:
../ijo.c:67: warning: 'TIMER0_OVF_vect' appears to be a misspelled signal handler
Kod: Zaznacz cały
#include <avr/io.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
const PROGMEM uint8_t g_ledrida[5] PROGMEM ={
0b111111,
0b000000,
0b111111,
0b000000,
0b111111,
};
const PROGMEM uint8_t g_ledpolb[11] PROGMEM ={
0b111111,
0b111000,
0b111111,
0b111000,
0b111111,
0b111111,
0b000111,
0b111111,
0b000111,
0b111111,
0b111111,
};
volatile uint8_t m=0;
int main(void)
{
DDRB = 0xFD; //Port B jako wyjscia
PORTB = 0xFF; //na poczatek ledy wygaszone
TCCR0B |= (1 << CS01);
TIMSK0 |= (1<<OCIE0B);
sei(); //Globalne uruchomienie przerwań
while(1){
if(!(PINB & 1<<PB1)){
_delay_ms(400);
if(!(PINB & 1<<PB1)){
_delay_ms(400);
{
m++;
}
if(m>4)
{
m=0;
}
if(m==0)
{
PORTB = 0xFF;
}
}
}
}
}
ISR(TIMER0_OVF_vect)
{
static uint8_t t,s,g,c;
if(m==1)
{
PORTB = pgm_read_byte(&g_ledrida[s]);
s++;
if(s>4)
s=0;
}
else if(m==2)
{
PORTB = pgm_read_byte(&g_ledpolb[c]);
c++;
if(c>10)
c=0;
}
else if(m==3)
{
g++;
if(g>4)
g=0;
PORTB = pgm_read_byte(&g_ledpolb[t]);
t++;
if(t>10)
t=0;
}
}