/* * File: main.cpp * Author: naopross * * Created on May 1, 2018, 6:18 PM */ #include #include // basic devices #include "hal/confbits.hpp" #include "hal/hwconfig.hpp" // specific devices #include "hal/uart.tpp" #include "hal/pin.tpp" extern "C" { #include #include } 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); led1.set(1); led2.set(1); 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; }