summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.cpp43
1 files changed, 18 insertions, 25 deletions
diff --git a/main.cpp b/main.cpp
index a1b4407..5347507 100644
--- a/main.cpp
+++ b/main.cpp
@@ -8,36 +8,29 @@
#include <stdio.h>
#include <stdlib.h>
-#include "mcc_generated_files/mcc.hpp"
+// #include "mcc_generated_files/mcc.h"
+
+#include "hal/uart1.tpp"
+#include "hal/pin.tpp"
+
+extern "C" {
+ #include <xc.h>
+}
+
+
-/*
- *
- */
int main(int argc, char** argv)
{
- char c;
-
- SYSTEM_Initialize();
-
- LED1_SetHigh();
- LED2_SetHigh();
- LED3_SetHigh();
-
- UART1_Write('S');
- UART1_Write('\n');
- UART1_Write('\r');
+ LATE = 0x0000;
+ TRISE = 0x002f;
+ CNPUE = 0x0000;
+
+ pin<decltype(LATEbits), 4> led1(&LATEbits);
+ led1.set(1);
- while (1) {
- while (UART1_ReceiveBufferIsEmpty());
-
- c = UART1_Read();
- LED1_Toggle();
-
- UART1_Write(c);
- UART1_Write('\n');
- UART1_Write('\r');
+ while (true) {
}
- return (EXIT_SUCCESS);
+ return 0;
}