diff options
author | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2009-12-17 02:37:07 +0000 |
---|---|---|
committer | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2009-12-17 02:37:07 +0000 |
commit | 32e57dac2e61e79b029593eb4d34d727bcc10678 (patch) | |
tree | 98d7ff41993576bb150d13d5f63dc744f6812852 /src/main.cpp | |
download | librambutan-32e57dac2e61e79b029593eb4d34d727bcc10678.tar.gz librambutan-32e57dac2e61e79b029593eb4d34d727bcc10678.zip |
Initial commit of library code, moved from leaftest repo
git-svn-id: https://leaflabs.googlecode.com/svn/trunk/library@69 749a229e-a60e-11de-b98f-4500b42dc123
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..2007c2f --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,67 @@ +#include "stm32f10x_map.h"
+#include "stm32f10x_lib.h"
+#include "stm32f10x_flash.h"
+#include "stm32f10x_usart.h"
+#include "Serial.h"
+#include "timers.h"
+#include "wiring.h"
+#include "util.h"
+#include "systick.h"
+#include "adc.h"
+#include "gpio.h"
+#include "pwm.h"
+#include "ext_interrupts.h"
+#include "usart.h"
+
+void setup();
+void loop();
+
+int ledPin = 13;
+
+void setup()
+{
+// Serial1.begin(9600);
+// Serial1.println("setup start");
+
+// pinMode(ledPin, OUTPUT);
+ pinMode(1, GPIO_MODE_AF_OUTPUT_PP);
+ pinMode(0, INPUT);
+
+ pinMode(ledPin, OUTPUT);
+
+// usart_init(2);
+
+
+// Serial1.println("setup end");
+}
+
+int toggle = 0;
+
+void loop() {
+ toggle ^= 1;
+ digitalWrite(ledPin, toggle);
+ delay(100);
+}
+
+
+int main(void)
+{
+ init();
+ setup();
+
+ while (1) {
+ loop();
+ }
+ return 0;
+}
+
+
+/* Implemented:
+ * void pinMode(pin, mode)
+ * void digitalWrite(pin, value)
+ * uint32_t digitalRead(pin)
+ * uint32_t analogRead(pin)
+ * void randomSeed(seed)
+ * long random(max)
+ * long random(min, max)
+ * */
|