W whcir Member Licensed User Longtime User Feb 18, 2017 #1 How do you access a sub routine in b4r from inline C? The second argument (led_Tick) in the third line requires a sub routine as a parameter, what syntax do you use Code: #if C #include <RTClock.h> void RTCinit (B4R::Object* o) { rtc_init(RTCSEL_LSI); rtc_set_prescaler_load(0x7fff); rtc_attach_interrupt(RTC_SECONDS_INTERRUPT, led_Tick); } #End if
How do you access a sub routine in b4r from inline C? The second argument (led_Tick) in the third line requires a sub routine as a parameter, what syntax do you use Code: #if C #include <RTClock.h> void RTCinit (B4R::Object* o) { rtc_init(RTCSEL_LSI); rtc_set_prescaler_load(0x7fff); rtc_attach_interrupt(RTC_SECONDS_INTERRUPT, led_Tick); } #End if
rwblinn Well-Known Member Licensed User Longtime User Feb 18, 2017 #2 Hi, try as example, if the sub routine led_Tick is defined in the main class: Code: b4r_main::_led_tick To explore the B4R generated code, lookup the <project>/objects/src folder ... checkout like b4r_main.h and b4r_main.cpp ... and others if more classes. In the b4r_main.h, there should be an entry like Code: static void _led_tick(); Please note that the functions are in lowercase! Upvote 0
Hi, try as example, if the sub routine led_Tick is defined in the main class: Code: b4r_main::_led_tick To explore the B4R generated code, lookup the <project>/objects/src folder ... checkout like b4r_main.h and b4r_main.cpp ... and others if more classes. In the b4r_main.h, there should be an entry like Code: static void _led_tick(); Please note that the functions are in lowercase!