summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/main.cpp b/main.cpp
index d95bc74..860460c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -5,7 +5,7 @@
* Created on May 1, 2018, 6:18 PM
*/
-#include <string>
+#define DEBUG
// basic devices
#include "hal/confbits.hpp"
@@ -15,6 +15,10 @@
#include "hal/uart.tpp"
#include "hal/pin.tpp"
+// standard library
+#include <string>
+
+// microchip libraries
extern "C" {
#include <xc.h>
// #include <proc/p32mx470f512h.h>
@@ -40,9 +44,9 @@ int main(int argc, char** argv)
while (true) {
while (uart::rx_buffer<1>().empty());
-
- while (!uart::rx_buffer<1>().empty()) {
- uint8_t c = uart::read<1>();
+ while (uart::rx_buffer<1>().size() > 0) {
+ char c = uart::read<1>();
+
uart::write<1>(c);
uart::write<1>("\n\r");
}