Fix missing DDR initialisation for led driver
This commit is contained in:
parent
168e453193
commit
3d53f30331
2 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
MCU_TARGET = atmega328p
|
||||
MCU_FREQ = 16000000UL
|
||||
CPPFLAGS += -DLED_PORT=PORTB -DLED_PIN=5
|
||||
|
||||
CPPFLAGS += -DLED_DDR=DDRB -DLED_PORT=PORTB -DLED_PIN=5
|
||||
|
||||
AVRDUDE_TYPE = arduino
|
||||
AVRDUDE_TTY = /dev/ttyUSB0
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#include "led.h"
|
||||
#include <avr/io.h>
|
||||
|
||||
void __attribute__ ((naked)) __attribute__ ((section (".init5"))) led_init() {
|
||||
LED_DDR |= (1 << LED_PIN);
|
||||
}
|
||||
|
||||
void led(uint8_t on) {
|
||||
if (on) {
|
||||
LED_PORT |= (1 << LED_PIN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue