2018-02-16 02:38 AM
I am trying to understand what 'sim()' does in the example code that comes on the STM8L-DISCOVERY eval board (Introduction to STM8L15x power saving modes using the STM8L-DISCOVERY IDD measurement feature) where the source can be downloaded from
In the Project/Discover/src/icc_measure.c file in function ADC_Icc_Test it runs 'sim()' and I cannot find a definition anywhere what this function does - example:
/* Low power mode */
case MCU_LPR:
Halt_Init();
sim();/* To prepare to start counter */
GPIO_HIGH(CTN_GPIO_PORT,CTN_CNTEN_GPIO_PIN);
/* To configure Low Power */
LPR_init();
break;
I guess this must be some built-in C function as I can't find it in any of the source or Library files, but I can't find definition on Google
Thanks
Mike
#stm8l-discovery #sim #stm8 #stm8lSolved! Go to Solution.
2018-02-16 03:27 AM
It's the c version of assembly sim instruction, opposite of rim. To disable and enable interrupts. The device header files or intrinsically should have it.
2018-02-16 03:27 AM
It's the c version of assembly sim instruction, opposite of rim. To disable and enable interrupts. The device header files or intrinsically should have it.
2018-02-16 04:49 AM
,
,
Thanks - I had looked in .c files in 'user' and libraries and .h files in 'user', but forgot .h files in libraries - so with your help, I have now located in ,Libraries/STM8L15x_StdPeriph_Driver/inc/stm8l15x.h :
♯ define rim() _rim_() /*!<,enable interrupts */
,
♯ define sim() _sim_() /*!<,disable interrupts */Thanks again
Mike