Browse Source

Fix lab04 based on feedback

lab04-alt
Arti Zirk 3 years ago
parent
commit
6472da9c13
2 changed files with 6 additions and 2 deletions
  1. +5
    -1
      src/main.c
  2. +1
    -1
      src/uart-wrapper.c

+ 5
- 1
src/main.c View File

@@ -3,6 +3,7 @@
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <util/atomic.h>
#include <util/delay.h>
#include "hmi_msg.h"
#include "uart-wrapper.h"
@@ -80,7 +81,10 @@ static inline void search_month() {

static inline void heartbeat() {
static uint32_t last_time;
uint32_t cur_time = time;
uint32_t cur_time;
ATOMIC_BLOCK(ATOMIC_FORCEON) {
cur_time = time;
}
if ((last_time - cur_time) > 0) {
// Toggle led on arduino pin 25
PORTA ^= _BV(PORTA3);

+ 1
- 1
src/uart-wrapper.c View File

@@ -29,5 +29,5 @@ int uart3_putchar(char c, FILE *stream)
int uart0_getchar(FILE *stream)
{
(void) stream;
return (unsigned char)uart0_getc();
return uart0_getc() & 0xff;
}

Loading…
Cancel
Save