From 5e8e628da03121323351e54e6866826288e4c4bd Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 4 May 2018 18:27:12 +0200 Subject: Implement most of basic HAL Oscillator: The oscillator is configured correctly. Interrupts: RX uart interrupts work. The global interrupt vector table is enabled. UART: RX features work. --- hal/pin.tpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'hal/pin.tpp') diff --git a/hal/pin.tpp b/hal/pin.tpp index c6cf957..3954945 100644 --- a/hal/pin.tpp +++ b/hal/pin.tpp @@ -1,10 +1,12 @@ /* - * File: pin.cpp + * File: pin.tpp * Author: naopross * * Created on May 3, 2018, 8:02 PM */ +#ifndef PIN_TPP +#define PIN_TPP #include "pin.hpp" @@ -32,21 +34,21 @@ template void pin::set_mode(unsigned m) { if (m) - *_tris |= 1< void pin::set_mode(pin::mode m) { - set(static_cast(m)); + set_mode(static_cast(m)); } template typename pin::state pin::read() const { - if (*_tris & (1<::state pin::read() const template void pin::set(unsigned s) { - if (s) - *_latch |= 1< 0) + *_latch |= 1< @@ -86,3 +88,5 @@ bool pin::operator!=(const pin &other) const { return !(*this == other); } + +#endif \ No newline at end of file -- cgit v1.2.1