ISR expects to return an integer? [solved: missing .h]

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Clearly I have something goofed up, but where?

#include "leds.h"
#include 

uint8_t ledMode = 0 ;

ISR(TCC4_OVF_vect)
{
	TCC4.INTFLAGS = TCC4.INTFLAGS ;
	if ((ledMode & 1) != 0 )
	{
		TCC4.CCA += 1 ;
		if (TCC4.CCA == 256) TCC4.CCA = 0 ;
		TCC4.CCC = 0 ;
	}
	else
	{
		TCC4.CCA = 0 ;
		TCC4.CCC += 2 ;
		if (TCC4.CCC >= 256) TCC4.CCC = 0 ;
	}
}

The compiler gives me 3 warnings on this

Warning 1 return type defaults to 'int' [enabled by default] C:\Users\Tom\Documents\Atmel Studio\6.1\BotanicVolcano\leds.c 31 1 BotanicVolcano

Warning 2 type of '__vector_12' defaults to 'int' [enabled by default] C:\Users\Tom\Documents\Atmel Studio\6.1\BotanicVolcano\leds.c 31 1 BotanicVolcano

Warning 3 control reaches end of non-void function [-Wreturn-type] C:\Users\Tom\Documents\Atmel Studio\6.1\BotanicVolcano\leds.c 46 1 BotanicVolcano

leds.h

#ifndef LEDS_H_
#define LEDS_H_

void ledsOK(void);
void ledsNoContact(void);
void ledsFluidOk(void);
void ledsFluidLow(void);

void ledsInit(void);



#endif /* LEDS_H_ */

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

#include

I didn't include interrupt.h. Mysterious warnings explained and removed.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut.