ciaa / firmware_v1

Firmware de la CIAA
http://www.proyecto-ciaa.com.ar
125 stars 120 forks source link

OSEK Generator: Fix ALARMCALLBACK OIL syntax. #110

Closed pridolfi closed 9 years ago

pridolfi commented 10 years ago

In order to use an alarm with callback, currently we need to define the OIL configuration like this: ALARM myAlarmCallback { COUNTER = SoftwareCounter; ACTION = ALARMCALLBACK { CALLBACK = alCallback; } } But the OIL standard (http://portal.osek-vdx.org/files/pdf/specs/oil25.pdf), section 3.2.6.4, specifies the correct syntax: ALARM RunCallbackC { COUNTER = SysCounter; ACTION = ALARMCALLBACK { ALARMCALLBACKNAME = "CallbackC"; }; AUTOSTART = FALSE; }; So we need to fix Os_Cfg.h.php (https://github.com/ciaa/Firmware/blob/master/modules/rtos/gen/inc/Os_Cfg.h.php#L294) from this: print "extern void OSEKCALLBACK" . $config->getValue("/OSEK/" . $alarm . "/ALARMCALLBACK", "CALLBACK") . "(void);\n"; to this: print "extern void OSEKCALLBACK" . $config->getValue("/OSEK/" . $alarm . "/ALARMCALLBACK", "ALARMCALLBACKNAME") . "(void);\n";

pridolfi commented 10 years ago

Also we need to remove the quotation marks :( This is the generated output if we don't: extern void OSEKCALLBACK"alCallback"(void);

Suggested fix: "OSEKCALLBACK" . substr($config->getValue("/OSEK/" . $alarm . "/ALARMCALLBACK", "ALARMCALLBACKNAME"),1,-1)

Also we need to fix Os_Internal_Cfg.c.php: https://github.com/ciaa/Firmware/blob/master/modules/rtos/gen/src/Os_Internal_Cfg.c.php#L379

mcerdeiro commented 9 years ago

Is this issue fixed? can we close it?

mcerdeiro commented 9 years ago

pablo is this issue done? please close it :+1: thanks

pridolfi commented 9 years ago

Yep! Closed.