Hi,
I have a problem with my program. Global Interrupts disables itself.
I am using Atmel Studio 6 SP1 with latest tool-chain (Version: 3.4.1.798 - GCC 4.6.2) and default project settings. Target CPU is ATmega16.
I've managed to isolate the problem in this simple test case:
Interrupts are disabled by BufferAdd function, the question is why? :-(
Thanks for your help.
#include#include typedef struct { uint8_t address; uint8_t data[5]; } Message; typedef struct { Message mess[4]; uint8_t Head; uint8_t Tail; } TransmitBufer ; TransmitBufer buff; void BufferAdd(Message msg) { buff.Head++; buff.mess[buff.Head] = msg; } int main(void) { sei(); //Interrupts are enabled Message msg; BufferAdd(msg); //GIE disables itself here! while(1) { asm volatile ("nop"); } }