diff 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
line wrap: on
line diff
--- a/python/stm32f4/blink.c3	Fri Jul 12 17:42:39 2013 +0200
+++ b/python/stm32f4/blink.c3	Sat Jul 13 11:12:24 2013 +0200
@@ -2,9 +2,28 @@
 package blink;
 
 // import bla
-//type struct TIM2_s {
+type struct {
 //  uint32_t SR;
-//};
+} TIM_Type;
+
+type struct {
+    int MODER;
+    int OTYPER;
+    int OSPEEDR;
+    int PUPDR;
+    int IDR;
+    int ODR;
+} GPIO_Type;
+
+const GPIO_Type* GPIOD = cast<GPIO_Type*>(0x400000);
+
+function void delay(int count)
+{
+    while (count > 0)
+    {
+        count = count - 1;
+    }
+}
 
 // Globals:
 var int divider;
@@ -29,6 +48,8 @@
 {
     divider = 0;
 
+    // delay(100);
+
     var int* RCC_AHB1ENR;
     RCC_AHB1ENR = cast<int*>(0x40003022);
     *RCC_AHB1ENR = *RCC_AHB1ENR | 8943;