diff options
| author | Perry Hung <iperry@alum.mit.edu> | 2010-03-23 01:41:08 -0400 |
|---|---|---|
| committer | Perry Hung <iperry@alum.mit.edu> | 2010-03-23 01:41:08 -0400 |
| commit | 8d6bf3b196c2a0bc1adda4a04669e54fdc5b65cb (patch) | |
| tree | 830da6f6d88f61ef4264905f7138cfc73b903ab2 /src/example_main_bk.cpp | |
| parent | 3639ad2cf027da7425ebe76382842c006acec05a (diff) | |
Removed main.cpp and updated example_main.cpp and added a blinky
version. New users are expected to write their or main.cpp or copy
from an example version.
Diffstat (limited to 'src/example_main_bk.cpp')
| -rw-r--r-- | src/example_main_bk.cpp | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/src/example_main_bk.cpp b/src/example_main_bk.cpp deleted file mode 100644 index ce1b1c1..0000000 --- a/src/example_main_bk.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "wiring.h"
-#include "HardwareSerial.h"
-#include "HardwareUsb.h"
-#include "math.h"
-#include "usb.h"
-
-int ledPin = 13;
-uint8_t bytes_in;
-
-BootVectTable* mapleVect;
-
-void usb_tx_cb(void) {
-}
-
-void usb_rx_cb(void) {
- bytes_in = usb_serialGetRecvLen();
-}
-
-void setup()
-{
- pinMode(ledPin, OUTPUT);
- Serial2.begin(9600);
- Serial2.println("setup start");
-
- pinMode(6, PWM);
- pwmWrite(6, 0x8000);
- pinMode(7, OUTPUT);
-
- Serial2.println("setup end");
-
- mapleVect = (BootVectTable*)(BOOTLOADER_VECT_TABLE);
- mapleVect->serial_tx_cb = usb_tx_cb;
- mapleVect->serial_rx_cb = usb_rx_cb;
-}
-
-
-int toggle = 0;
-
-const char* testMsg = "hello world!\n";
-
-static inline void loop() {
- toggle ^= 1;
- digitalWrite(ledPin, toggle);
- delay(1000);
- usb_serialWriteStr("blink...\n");
-
- if (bytes_in > 0) {
- int i;
- for (i=0;i<bytes_in;i++) {
- usb_serialWriteStr("b,");
- }
- bytes_in = 0;
- usb_serialWriteStr("\n");
- }
-}
-
-
-int main(void) {
- init();
- setup();
-
- while (1) {
- loop();
- }
- return 0;
-}
-
-/* Required for C++ hackery */
-/* TODO: This really shouldn't go here... move it later
- * */
-extern "C" void __cxa_pure_virtual(void) {
- while(1)
- ;
-}
|
