Thanks Rafael, I'll test this later today.
You wrote: "partially emulate" What do you mean by that, what __critical -functionality would disabling all interrupt not emulate? Or are you talking abou things like using a 'return/break' statement inside disabled section in which case of course the re-enabling of interrupts would not happen? br Kusti >>> rnei...@web.de 20.1.2009 10:45 >>> Hi, > But when I look at the compiled (assembler source code) I see no > difference with or without the __critical keyword nor any evidence > of any interrupt disabling code. > > So what am I doing wrong? Errr, nothing: __critical is not implemented for the PIC ports. You can partially emulate its effect by disabling interrupts manually and see if that helps. /* All code untested. */ iflags = (INTCON & 0xC0); INTCON &= ~0xC0; // critical code here INTCON |= iflags; or wrapped in a macro: #define CRITICAL(CODE) do { \ static unsigned char __sdcc_iflags = (INTCON & 0xC0); \ INTCON &= ~0xC0; \ do { CODE; } while (0); \ INTCON |= __sdcc_iflags; \ } while(0) CRITICAL(low = 1; high = 42); // or CRITICAL(critical_function()); Hope that helps, Raphael ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user