Permalink
Browse files

Device ws2812b (RGB LED Band)

  • Loading branch information...
RealMerlin committed Jan 31, 2019
1 parent ef440e6 commit 1ef81e5b01ca390cba75677ff7ab5f15fc0ba5cc
@@ -86,6 +86,7 @@ firmware:
cd hcanbl; $(xx) $(parm2)
cd firmwares/controllerboard; $(xx) $(parm2)
cd firmwares/userpanel-v01; $(xx) $(parm2)
# cd firmwares/ws2812-modul; $(xx) $(parm2)

firmwareOhneEds:
cd firmwares/usv-modul; $(xx)
@@ -0,0 +1,89 @@
# Makfile fuer ws2812-modul
#
.PHONY: release
include ../../ARCH.inc
#SHELL := /bin/bash

SRC = $(patsubst %.c, %.c , $(wildcard *.c))
SRC += $(patsubst %.c, %.c , $(wildcard ./devices/*.c))
SRC += $(patsubst %.c, %.c , $(wildcard ../../canix/*.c))

TARGET = main
adr = 1022

OBJCOPY = avr-objcopy
CXX = avr-gcc

ifeq ($(MCU),atmega328p)
F_CPU = 16000000
MCU_DIR = C1416_$(MCU)_$(F_CPU)MHz
else # MCU_atmega32 || MCU_atmega644p
F_CPU = 16000000
MCU_DIR = C1612_$(MCU)_$(F_CPU)MHz
endif

F_CAN = 8000000
CAN_SPEED = 125000

DEFINES = -DMCU_$(MCU) -DF_CPU=$(F_CPU) -DF_CAN=$(F_CAN) -DCAN_SPEED=$(CAN_SPEED) \
-DCANIX_SYSLOG -DCANIX_HMS -DCANIX_RTS -DCANIX_EDS
DEFINES += $(GLOBAL_DEFINES)

CFLAGS = -mmcu=$(MCU) -Wall -Werror -Wstrict-prototypes -Os -mcall-prologues
CFLAGS += -I. -I../../canix -I../.. -I../../include
CFLAGS += $(DEFINES)

all:
cp ../controllerboard/devices/powerport.* ./devices/
cp ../controllerboard/devices/ports.* ./devices/
cp ../controllerboard/devices/taster.* ./devices/
cp ../controllerboard/devices/poti.* ./devices/
cp ../controllerboard/devices/multitaster.* ./devices/
cp ../controllerboard/devices/mk_devices_h.xsl ./devices/
cp ../controllerboard/devices/mk_devices_c.xsl ./devices/
cp ../controllerboard/devices/mk_timer_c.xsl ./devices/
cp ../controllerboard/devices/Makefile ./devices/
cp ../controllerboard/timer.h ./
cp ../controllerboard/timeservice.* ./
cp ../controllerboard/dcf77_receiver.* ./
cp ../controllerboard/darlingtonoutput.* ./
cp ../controllerboard/input.* ./
cp ../controllerboard/twimaster.* ./
cp ../controllerboard/buildver ./
cd devices; make all
make allX

allX: $(TARGET).hex
mkdir -p $(MCU_DIR)
sudo mv $(TARGET).hex ./$(MCU_DIR)

$(TARGET).hex: $(TARGET).elf
$(OBJCOPY) -R .eeprom -O ihex $(TARGET).elf $(TARGET).hex
avr-size $(TARGET).hex

$(TARGET).elf:
$(CXX) $(CFLAGS) -o $(TARGET).elf $(SRC) -Wl,-Map,$(TARGET).map

clean_part:
sudo rm -f *.map *.elf

clean:
make clean_part
sudo rm -fR ./$(MCU_DIR)
find ./ -maxdepth 1 -type f \( ! -iname "main.c" ! -iname "Makefile" \) -delete
cd devices && find ./ -maxdepth 1 -type f \( ! -iname "ws2812b.c" ! -iname "ws2812b.h" \) -delete

load:
make all
@echo -------------------------
@echo Bsp.: make load adr=161
@echo -------------------------
telican -C -c $(adr) --arch $(MCU) -e "flash $(MCU_DIR)/$(TARGET).hex"
#telican --polite-time 2 -a $(IP_HI) -c $(adr) --arch $(MCU) -e "flash $(MCU_DIR)/$(TARGET).hex"

enableDebugWIRE_atmega328p:
avrdude -c avrispmkII -p $(MCU) -B 12000 -P usb -U hfuse:w:0x88:m

disableDebugWIRE_atmega328p:
@# moeglich: atmelice, atmelice_isp, atmelice_dw
avrdude -c atmelice_dw -p $(MCU) -P usb -U hfuse:w:0xC8:m
Oops, something went wrong.

0 comments on commit 1ef81e5

Please sign in to comment.