Timer ISR Problem

OP #1397875
Lesenswert?

HAllo Leute ich blicks gerade nicht.
Habe folgende Timer Routinen, aber der Compiler meldet ständig:

timer.c:13: warning: return type defaults to 'int'
timer.c:13: warning: function declaration isn't a prototype
timer.c: In function 'ISR':
timer.c:13: warning: type of '__vector_7' defaults to 'int'
timer.c:26: warning: control reaches end of non-void function

Ich verstehs echt nicht, fehlt da ein Compilerschalter oder ist echt 
noch ein fehler drin. Manchmal sieht man den Wald vor lauter Bäumen 
nicht mehr.
1
#include "timer.h"
2

3

4
void TimerInit (void)
5
{
6
      TCCR1B |= (1<<WGM12) | (1<<CS10 | 0<<CS11 | 1<<CS12);
7
      TCNT1 = 0;
8
      OCR1A = (F_CPU / 1024) - 1;
9
      TIMSK |= (1 << OCIE1A);
10
}
11

12
ISR(TIMER1_COMPA_vect)
13
{
14
  //tick 1 second
15
  sek++;
16

17
  if(sek==60){
18
    sek=0;
19
    min++;
20
    }
21
  if(min==60){
22
    min=0;
23
    std++;
24
    }
25
  if(std==24)std=0;
26
}

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren