summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 427378c..119e5ce 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,5 +1,5 @@
/*
- * File: main.c
+ * File: main.cpp
* Author: naopross
*
* Created on May 1, 2018, 6:18 PM
@@ -8,19 +8,27 @@
#include <stdio.h>
#include <stdlib.h>
-// #include "mcc_generated_files/mcc.h"
+// basic devices
+#include "hal/confbits.hpp"
+#include "hal/hwconfig.hpp"
+// specific devices
#include "hal/uart.tpp"
#include "hal/pin.tpp"
extern "C" {
#include <xc.h>
+ #include <proc/p32mx470f512h.h>
}
int main(int argc, char** argv)
{
+ osc::initialize();
+ interrupts::initialize();
+ uart::initialize<1>();
+
pin<4> led1(&LATEbits, &TRISEbits, &PORTEbits);
pin<6> led2(&LATEbits, &TRISEbits, &PORTEbits);
pin<7> led3(&LATEbits, &TRISEbits, &PORTEbits);
@@ -30,6 +38,14 @@ int main(int argc, char** argv)
led3.set(1);
while (true) {
+ while (uart::rx_buffer_empty<1>());
+// while (!uart::rx_buffer_empty<1>()) {
+// uart::write<1>(uart::read<1>());
+// uart::write<1>("\n\rk")
+// }
+
+ uart::read<1>();
+ led1.toggle();
}
return 0;