diff options
author | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2009-12-19 10:53:07 +0000 |
---|---|---|
committer | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2009-12-19 10:53:07 +0000 |
commit | acf59b1abb346998c492b93fee4a680a32f538d5 (patch) | |
tree | c49dd57f489769608095736457a0db9350868a47 /src/lib/util.cpp | |
parent | af4c4985cef82b80b936584d686c80d9538082b6 (diff) | |
download | librambutan-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/lib/util.cpp')
-rw-r--r-- | src/lib/util.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/lib/util.cpp b/src/lib/util.cpp deleted file mode 100644 index 4eb4fe0..0000000 --- a/src/lib/util.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "wiring.h" -#include "Serial.h" -#include "util.h" -#include "io.h" - -#define ERROR_PIN 13 - -/* Required for C++ hackery */ -extern "C" void __cxa_pure_virtual(void) { - while(1) - ; -} - -/* Error assert + fade */ -void _fail(const char* file, int line, const char* exp) { - int32_t slope = 1; - int32_t CC = 0x0000; - int32_t TOP_CNT = 0x02FF; - int32_t i = 0; - - Serial1.print("ERROR: FAILED ASSERT("); - Serial1.print(exp); - Serial1.print("): "); - Serial1.print(file); - Serial1.print(":"); - Serial1.println(line); - - while (1) { - if (CC == TOP_CNT) { - slope = -1; - } else if (CC == 0) { - slope = 1; - } - - if (i == TOP_CNT) { - CC += slope; - i = 0; - } - - if (i < CC) { - digitalWrite(ERROR_PIN, HIGH); - } else { - digitalWrite(ERROR_PIN, LOW); - } - i++; - } -} |