aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authoriperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123>2009-12-19 10:53:07 +0000
committeriperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123>2009-12-19 10:53:07 +0000
commitacf59b1abb346998c492b93fee4a680a32f538d5 (patch)
treec49dd57f489769608095736457a0db9350868a47 /src/main.cpp
parentaf4c4985cef82b80b936584d686c80d9538082b6 (diff)
downloadlibrambutan-acf59b1abb346998c492b93fee4a680a32f538d5.tar.gz
librambutan-acf59b1abb346998c492b93fee4a680a32f538d5.zip
Added licensing. Moved lots of header files around. Added HardwareSerial reads, writes. Tweaked some of the util and assert functions. Added various useful routines for printing stuff to the serial port. Continued moving out stm32lib. Slightly more consistent naming, this will come in another change.
git-svn-id: https://leaflabs.googlecode.com/svn/trunk/library@74 749a229e-a60e-11de-b98f-4500b42dc123
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp49
1 files changed, 15 insertions, 34 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2266f3d..46037bd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,17 +1,6 @@
-#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"
+#include "HardwareSerial.h"
+#include "math.h"
#include "usb.h"
void setup();
@@ -19,21 +8,17 @@ 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);
+ Serial2.begin(9600);
+ Serial2.println("setup start");
-// usart_init(2);
-
+ pinMode(6, PWM);
+ pwmWrite(6, 0x8000);
-// Serial1.println("setup end");
+ Serial2.println("setup end");
}
int toggle = 0;
@@ -50,8 +35,7 @@ void loop() {
}
-int main(void)
-{
+int main(void) {
init();
setup();
@@ -61,13 +45,10 @@ int main(void)
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)
+/* Required for C++ hackery */
+/* TODO: This really shouldn't go here... move it later
* */
+extern "C" void __cxa_pure_virtual(void) {
+ while(1)
+ ;
+}