2012-06-15 21:51:23 +00:00
|
|
|
#include "stm32f0xx_conf.h"
|
|
|
|
|
2012-06-16 17:37:50 +00:00
|
|
|
void SysTick_Handler(void) {
|
|
|
|
static uint16_t tick = 0;
|
2012-06-16 18:47:01 +00:00
|
|
|
|
2012-06-16 17:37:50 +00:00
|
|
|
switch (tick++) {
|
|
|
|
case 100:
|
|
|
|
tick = 0;
|
|
|
|
GPIOC->ODR ^= (1 << 8);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-06-15 20:10:19 +00:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
|
2012-06-16 18:47:01 +00:00
|
|
|
RCC->AHBENR |= RCC_AHBENR_GPIOCEN; // enable the clock to GPIOC
|
2012-06-15 21:51:23 +00:00
|
|
|
//(RM0091 lists this as IOPCEN, not GPIOCEN)
|
2012-06-15 21:17:36 +00:00
|
|
|
|
2012-06-15 20:10:19 +00:00
|
|
|
GPIOC->MODER = (1 << 16);
|
2012-06-16 18:47:01 +00:00
|
|
|
|
2012-06-16 17:37:50 +00:00
|
|
|
SysTick_Config(SystemCoreClock/100);
|
2012-06-16 18:47:01 +00:00
|
|
|
|
2012-06-15 21:51:23 +00:00
|
|
|
while(1);
|
2012-06-16 18:47:01 +00:00
|
|
|
|
2012-06-15 20:10:19 +00:00
|
|
|
}
|