- explicit disable wdt_disable

- use switch for leaving error mode
- use Uart with message fifo
- fixed portGet, added PwrSwitch_in

git-svn-id: http://moon:8086/svn/projects/HendiControl@33 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-03-02 11:17:38 +00:00
parent 0bd94e6859
commit 7f6dfc2928
6 changed files with 115 additions and 116 deletions
+15 -2
View File
@@ -5,12 +5,25 @@
* Author: jens
*/
#include <avr/io.h>
#include <stdio.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "uart.h"
#include "message.h"
void uart_init(uint16_t BAUD_PRESCALE)
static Fifo *g_pFifo = NULL;
ISR(USART_RX_vect)
{
uint8_t rx_data = UDR0;
Msg_t msg = {Uart, rx_data};
fifo_push(g_pFifo, &msg);
}
void uart_init(Fifo *pFifo, uint16_t BAUD_PRESCALE)
{
g_pFifo = pFifo;
// Set baud rate
UBRR0L = (uint8_t)BAUD_PRESCALE;
UBRR0H = (uint8_t)(BAUD_PRESCALE >> 8);