A typical example for using the CMSIS layer is provided below. The example is based on a STM32F10x Device.
#include <stm32f10x.h>
uint32_t volatile msTicks;
void SysTick_Handler (void) {
msTicks++;
}
void WaitForTick (void) {
uint32_t curTicks;
curTicks = msTicks;
while (msTicks == curTicks) {
}
}
void TIM1_UP_IRQHandler (void) {
;
}
void timer1_init(int frequency) {
}
void Device_Initialization (void) {
:
}
timer1_init ();
}
void main (void) {
Device_Initialization ();
while (1) {
Get_InputValues ();
Calculation_Response ();
Output_Response ();
WaitForTick ();
}
}