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