How to use cubeMX created semaphores inside another source file? CubeMX creates semaphores inside app_freertos.c but they are not accessible from custom source files??
I am using STM32CubeMX with FreeRTOS/ CMSIS_RTOS_V2. However I think I have not understood the logic behind the creation of the files.
- CubeMX created a file "app_freertos.c" without a header file and the semaphore created is inside this file.
- I have two other files "busA.h" and "busA.c" where I use a couple of Timer ISRs with STM Low Layer APIs. "busA.h" is included inside "stm32g0xx_it.c".
I need to call osSemaphoreRelease(semaphoreId) inside one of those ISR callbacks but because CubeMX created the semaphore inside "app_freertos.c", I just can't access it. It seems the semaphore scope is limited to "app_freertos.c". The problem is I have a lot going on inside my files (busA.c), bunch of variables etc. I am %90 sure if I try to move everything inside "app_freertos.c", it will be a mess.
Shall I create a header file manually for "app_freertos.c", namely "app_freertos.h" and return semaphore address into my "busA.c" file (with a function)?
