summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-05-04 00:16:36 +0200
committerNao Pross <naopross@thearcway.org>2018-05-04 00:16:36 +0200
commitc3767ac0c6bcb9a1aed1e7b666061f829a371e1f (patch)
tree36d1339fb999c066f424b8f03707e9a996aff02a /main.cpp
parentDefined Heap size (diff)
downloadSAMLiquidSmoke-c3767ac0c6bcb9a1aed1e7b666061f829a371e1f.tar.gz
SAMLiquidSmoke-c3767ac0c6bcb9a1aed1e7b666061f829a371e1f.zip
Start own HAL implementation based on MCC's generated files
Other changes: - Undo conversion of MCC files to C++ - Delete old Led implementation
Diffstat (limited to 'main.cpp')
-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;
}