Mercurial > lcfOS
comparison python/stm32f4/blink.c3 @ 228:7f18ed9b6b7e
Removal of emptystatement class
author | Windel Bouwman |
---|---|
date | Sat, 13 Jul 2013 11:12:24 +0200 |
parents | 848c4b15fd0b |
children | 521567d17388 |
comparison
equal
deleted
inserted
replaced
227:82dfe6a32717 | 228:7f18ed9b6b7e |
---|---|
1 // This file blinks a LED on the STM32F4 discovery board. | 1 // This file blinks a LED on the STM32F4 discovery board. |
2 package blink; | 2 package blink; |
3 | 3 |
4 // import bla | 4 // import bla |
5 //type struct TIM2_s { | 5 type struct { |
6 // uint32_t SR; | 6 // uint32_t SR; |
7 //}; | 7 } TIM_Type; |
8 | |
9 type struct { | |
10 int MODER; | |
11 int OTYPER; | |
12 int OSPEEDR; | |
13 int PUPDR; | |
14 int IDR; | |
15 int ODR; | |
16 } GPIO_Type; | |
17 | |
18 const GPIO_Type* GPIOD = cast<GPIO_Type*>(0x400000); | |
19 | |
20 function void delay(int count) | |
21 { | |
22 while (count > 0) | |
23 { | |
24 count = count - 1; | |
25 } | |
26 } | |
8 | 27 |
9 // Globals: | 28 // Globals: |
10 var int divider; | 29 var int divider; |
11 //const TIM2_s *TIM2;// = (TIM2_s*)0x40004; | 30 //const TIM2_s *TIM2;// = (TIM2_s*)0x40004; |
12 | 31 |
27 | 46 |
28 function void main() | 47 function void main() |
29 { | 48 { |
30 divider = 0; | 49 divider = 0; |
31 | 50 |
51 // delay(100); | |
52 | |
32 var int* RCC_AHB1ENR; | 53 var int* RCC_AHB1ENR; |
33 RCC_AHB1ENR = cast<int*>(0x40003022); | 54 RCC_AHB1ENR = cast<int*>(0x40003022); |
34 *RCC_AHB1ENR = *RCC_AHB1ENR | 8943; | 55 *RCC_AHB1ENR = *RCC_AHB1ENR | 8943; |
35 /* | 56 /* |
36 RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN; | 57 RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN; |