Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
il il
il authored and il committed Nov 4, 2019
2 parents bb185e7 + d7bdb9f commit f9a70d47421a25f99bc0597fad5fa8ec927f7c5e
@@ -93,3 +93,9 @@ hcansocketd/hcansocketd
hcanswd/hcanswd
telican/telican
tools/hcanextid/hcanextid

firmwares/ws2812-modul/*
!firmwares/ws2812-modul/main.c
!firmwares/ws2812-modul/Makefile
firmwares/ws2812-modul/devices/*
!firmwares/ws2812-modul/devices/ws2812b.*
@@ -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)
@@ -67,17 +67,16 @@ void canix_SFP_HMS_handler(const canix_frame *frame)
answer.data[2] = 0;
if (SIGNATURE_1 == 0x95 && SIGNATURE_2 == 0x0F)
answer.data[2] += 0x30; // µC-Signatur: __AVR_ATmega328P__
/* abwaertskompatibel: else if (SIGNATURE_1 == 0x95 && SIGNATURE_2 == 0x02)
else if (SIGNATURE_1 == 0x95 && SIGNATURE_2 == 0x02)
answer.data[2] += 0x10; // µC-Signatur: __AVR_ATmega32__
else if (SIGNATURE_1 == 0x96 && SIGNATURE_2 == 0x0A)
answer.data[2] += 0x20; // µC-Signatur: __AVR_ATmega644P__
*/
#if defined (__AVR_ATmega32__)
answer.data[2] += 0x01; // compiliert fuer __AVR_ATmega32__
#elif defined (__AVR_ATmega644P__)
answer.data[2] += 0x02;
answer.data[2] += 0x02; // compiliert fuer __AVR_ATmega644P__
#elif defined (__AVR_ATmega328P__)
answer.data[2] += 0x03;
answer.data[2] += 0x03; // compiliert fuer __AVR_ATmega328P__
#endif
answer.data[3] = eeprom_read_byte((uint8_t *)EEPR_BOARD_TYPE);
answer.size = 4;
@@ -67,6 +67,14 @@ void devices_load_config(void)
data_size = sizeof (device_data_<xsl:value-of select="@name" />);
break;
</xsl:for-each>
case EDS_dcf77_receiver_BLOCK_ID:
config_size = sizeof(eds_dcf77_receiver_block_t);
data_size = sizeof(device_data_dcf77_receiver);
break;
case EDS_timeservice_BLOCK_ID:
config_size = sizeof(eds_timeservice_block_t);
data_size = sizeof(device_data_timeservice);
break;
default:
// Falls wir den Block Typ (ausser 255) nicht kennen, dann
// geben wir eine Syslog Meldung aus
@@ -151,7 +159,9 @@ void devices_load_config(void)
<xsl:value-of select="@name" />_init( (device_data_<xsl:value-of select="@name" />*) p, it);
break;
</xsl:for-each>

case EDS_dcf77_receiver_BLOCK_ID:
dcf77_receiver_init((device_data_dcf77_receiver *) p, it);
break;

}
}
@@ -12,6 +12,8 @@
#define DEVICES_H

#include &lt;canix/eds.h&gt;
#include "dcf77_receiver.h"
#include "timeservice.h"
<xsl:apply-templates select="device" />
// definiert die Groesse der verschiedenen Device-Configs im EEPROM
extern uint8_t device_config_size[];
@@ -44,4 +46,4 @@ void hauselektrik_callback(const canix_frame *frame);
#include "devices/<xsl:value-of select="@name" />.h"
</xsl:template>

</xsl:stylesheet>
</xsl:stylesheet>
@@ -86,6 +86,9 @@ void idle_handler(void)
<xsl:value-of select="@name" />_timer_handler( (device_data_<xsl:value-of select="@name" />*) p, 100);
break;
</xsl:for-each>
case EDS_dcf77_receiver_BLOCK_ID:
dcf77_receiver_timer_handler((device_data_dcf77_receiver *) p, 100);
break;
}
}
}
@@ -163,4 +166,4 @@ void idle_handler(void)
</xsl:template>


</xsl:stylesheet>
</xsl:stylesheet>
@@ -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

0 comments on commit f9a70d4

Please sign in to comment.
You can’t perform that action at this time.