re-add n22.
This commit is contained in:
@@ -2,44 +2,9 @@
|
|||||||
|
|
||||||
<gwbuild>
|
<gwbuild>
|
||||||
|
|
||||||
<target type="AvrHexFile" name="n22_firmware" >
|
|
||||||
|
|
||||||
<includes type="avrasm" >
|
|
||||||
-I $(builddir)
|
|
||||||
-I $(srcdir)
|
|
||||||
-I $(topsrcdir)/avr
|
|
||||||
-I $(topbuilddir)/avr
|
|
||||||
</includes>
|
|
||||||
|
|
||||||
|
|
||||||
<sources type="avrasm" >
|
|
||||||
main.asm
|
|
||||||
</sources>
|
|
||||||
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<target type="AvrHexFile" name="n22_boot" >
|
|
||||||
|
|
||||||
<includes type="avrasm" >
|
|
||||||
-I $(builddir)
|
|
||||||
-I $(srcdir)
|
|
||||||
-I $(topsrcdir)/avr
|
|
||||||
-I $(topbuilddir)/avr
|
|
||||||
</includes>
|
|
||||||
|
|
||||||
|
|
||||||
<sources type="avrasm" >
|
|
||||||
boot.asm
|
|
||||||
</sources>
|
|
||||||
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<subdirs>
|
<subdirs>
|
||||||
|
boot
|
||||||
|
main
|
||||||
</subdirs>
|
</subdirs>
|
||||||
|
|
||||||
<extradist>
|
<extradist>
|
||||||
@@ -50,4 +15,3 @@
|
|||||||
|
|
||||||
</gwbuild>
|
</gwbuild>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
32
avr/devices/n22/boot/0BUILD
Normal file
32
avr/devices/n22/boot/0BUILD
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml?>
|
||||||
|
|
||||||
|
<gwbuild>
|
||||||
|
|
||||||
|
<target type="AvrHexFile" name="n22_boot" >
|
||||||
|
|
||||||
|
<includes type="avrasm" >
|
||||||
|
-I $(builddir)
|
||||||
|
-I $(srcdir)
|
||||||
|
-I $(topsrcdir)/avr
|
||||||
|
-I $(topbuilddir)/avr
|
||||||
|
</includes>
|
||||||
|
|
||||||
|
|
||||||
|
<sources type="avrasm" >
|
||||||
|
boot.asm
|
||||||
|
</sources>
|
||||||
|
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<subdirs>
|
||||||
|
</subdirs>
|
||||||
|
|
||||||
|
<extradist>
|
||||||
|
</extradist>
|
||||||
|
|
||||||
|
|
||||||
|
</gwbuild>
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
.include "include/tn85def.inc" ; Define device ATtiny85
|
.include "include/tn85def.inc" ; Define device ATtiny85
|
||||||
.list
|
.list
|
||||||
|
|
||||||
.include "./defs.asm"
|
.include "../defs.asm"
|
||||||
.include "defs_all.asm"
|
.include "defs_all.asm"
|
||||||
|
|
||||||
|
|
||||||
@@ -109,6 +109,7 @@ main:
|
|||||||
.include "modules/flash/io.asm"
|
.include "modules/flash/io.asm"
|
||||||
.include "modules/flash/io_attn.asm"
|
.include "modules/flash/io_attn.asm"
|
||||||
.include "modules/flash/io_bitbang.asm"
|
.include "modules/flash/io_bitbang.asm"
|
||||||
|
.include "modules/flash/flashxp.asm"
|
||||||
.include "modules/flash/flash1p.asm"
|
.include "modules/flash/flash1p.asm"
|
||||||
.include "modules/flash/flashprocess.asm"
|
.include "modules/flash/flashprocess.asm"
|
||||||
.include "modules/flash/wait.asm"
|
.include "modules/flash/wait.asm"
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
.equ LED_SIMPLE_OFFTIME = 50
|
.equ LED_SIMPLE_OFFTIME = 50
|
||||||
.equ LED_SIMPLE_DDR = DDRB
|
.equ LED_SIMPLE_DDR = DDRB
|
||||||
.equ LED_SIMPLE_PORT = PORTB
|
.equ LED_SIMPLE_PORT = PORTB
|
||||||
|
.equ LED_SIMPLE_PORTIN = PINB
|
||||||
.equ LED_SIMPLE_PINNUM = PORTB4
|
.equ LED_SIMPLE_PINNUM = PORTB4
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,333 +0,0 @@
|
|||||||
; ***************************************************************************
|
|
||||||
; copyright : (C) 2024 by Martin Preuss
|
|
||||||
; email : martin@libchipcard.de
|
|
||||||
;
|
|
||||||
; ***************************************************************************
|
|
||||||
; * This file is part of the project "AqHome". *
|
|
||||||
; * Please see toplevel file COPYING of that project for license details. *
|
|
||||||
; ***************************************************************************
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
|
||||||
; Source file for LED controller node on AtTiny 85
|
|
||||||
;
|
|
||||||
; This is for the full system (i.e. not the boot loader).
|
|
||||||
; ***************************************************************************
|
|
||||||
|
|
||||||
.equ clock=8000000 ; Define the clock frequency
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.nolist
|
|
||||||
.include "include/tn85def.inc" ; Define device ATtiny85
|
|
||||||
.list
|
|
||||||
|
|
||||||
.include "./defs.asm"
|
|
||||||
.include "defs_all.asm"
|
|
||||||
.include "common/utils_wait.asm" ; wait macro
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
|
||||||
; defines
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; firmware settings including list of modules used
|
|
||||||
|
|
||||||
.equ FIRMWARE_VERSION_MAJOR = 0
|
|
||||||
.equ FIRMWARE_VERSION_MINOR = 0
|
|
||||||
.equ FIRMWARE_VERSION_PATCHLEVEL = 1
|
|
||||||
|
|
||||||
|
|
||||||
#define MODULES_TIMER
|
|
||||||
#define MODULES_COM
|
|
||||||
#define MODULES_COM_WITH_ADDR_PROTO
|
|
||||||
#define MODULES_LED_SIMPLE
|
|
||||||
#define MODULES_STATS
|
|
||||||
#define MODULES_OWI_MASTER
|
|
||||||
#define MODULES_DS18B20
|
|
||||||
#define MODULES_SK6812
|
|
||||||
#define MODULES_MOTION_LIGHT
|
|
||||||
|
|
||||||
; #define COM_ACCEPT_ALL_DEST
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; defines for modules
|
|
||||||
|
|
||||||
;.equ VALUE_ID_SI7021_TEMP = 0x01
|
|
||||||
;.equ VALUE_ID_SI7021_HUM = 0x02
|
|
||||||
|
|
||||||
;.equ VALUE_ID_ADC = 0x03
|
|
||||||
;.equ VALUE_ID_REED1 = 0x04
|
|
||||||
;.equ VALUE_ID_REED2 = 0x05
|
|
||||||
.equ VALUE_ID_DS18B20_TEMP = 0x06
|
|
||||||
|
|
||||||
;.equ VALUE_ID_REED_CONF = 0x81
|
|
||||||
.equ VALUE_ID_LED_NUMLEDS = 0x82
|
|
||||||
.equ VALUE_ID_LED_RGBW_VALUE = 0x83
|
|
||||||
.equ VALUE_ID_MAL_RGBW_VALUE = 0x84
|
|
||||||
.equ VALUE_ID_MAL_ONTIME = 0x85
|
|
||||||
.equ VALUE_ID_MAL_SOURCE1 = 0x86
|
|
||||||
.equ VALUE_ID_MAL_SOURCE2 = 0x87
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
|
||||||
; code segment
|
|
||||||
|
|
||||||
.cseg
|
|
||||||
.org 000000
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; Reset and interrupt vectors
|
|
||||||
|
|
||||||
rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system
|
|
||||||
reti ; EXT_INT0
|
|
||||||
rjmp uartBitbangIsrPcint0 ; PCI0
|
|
||||||
reti ; OC1A
|
|
||||||
reti ; OVF1
|
|
||||||
reti ; OVF0
|
|
||||||
reti ; ERDY
|
|
||||||
reti ; ACI
|
|
||||||
reti ; ADCC
|
|
||||||
reti ; OC1B
|
|
||||||
rjmp baseTimerIrqOC0A ; OC0A
|
|
||||||
reti ; OC0B
|
|
||||||
reti ; WATCHDOG
|
|
||||||
reti ; USI_STR
|
|
||||||
reti ; USI_OVF
|
|
||||||
|
|
||||||
|
|
||||||
devInfoBlock: ; 12 bytes
|
|
||||||
devInfoManufacturer: .db 'A', 'Q', 'U', 'A'
|
|
||||||
devInfoId: .db DEVICEINFO_ID, 0
|
|
||||||
devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; version, revision
|
|
||||||
firmwareVersion: .db FIRMWARE_VARIANT_LEDSTRIPS, FIRMWARE_VERSION_MAJOR
|
|
||||||
.db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL
|
|
||||||
|
|
||||||
firmwareStart: rjmp main
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
|
||||||
; includes
|
|
||||||
|
|
||||||
.include "common/utils.asm"
|
|
||||||
.include "common/utils_wait_fixed.asm"
|
|
||||||
.include "common/utils_copy_from_flash.asm"
|
|
||||||
.include "common/utils_copy_sdram.asm"
|
|
||||||
.include "common/crc8.asm"
|
|
||||||
|
|
||||||
.include "modules/basetimer/main.asm"
|
|
||||||
|
|
||||||
#ifdef MODULES_TIMER
|
|
||||||
.include "modules/timer/main.asm"
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_LED_SIMPLE
|
|
||||||
.include "modules/led_simple/main.asm"
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_COM
|
|
||||||
.include "modules/com2/defs.asm"
|
|
||||||
.include "modules/com2/main.asm"
|
|
||||||
.include "modules/com2/buffer.asm"
|
|
||||||
#ifdef MODULES_STATS
|
|
||||||
.include "modules/comproto/msg_recvstats.asm"
|
|
||||||
.include "modules/comproto/msg_sendstats.asm"
|
|
||||||
.include "modules/comproto/msg_sysstats.asm"
|
|
||||||
.include "modules/comproto/msg_memstats.asm"
|
|
||||||
#endif
|
|
||||||
.include "modules/comproto/msg_pong.asm"
|
|
||||||
.include "modules/comproto/msg_value.asm"
|
|
||||||
.include "modules/comproto/msg_device.asm"
|
|
||||||
.include "modules/comproto/msg_reboot.asm"
|
|
||||||
.include "modules/uart_bitbang/defs.asm"
|
|
||||||
.include "modules/uart_bitbang/main.asm"
|
|
||||||
.include "modules/uart_bitbang/bytelevel.asm"
|
|
||||||
.include "modules/uart_bitbang/packetlevel.asm"
|
|
||||||
#ifdef MODULES_COM_WITH_ADDR_PROTO
|
|
||||||
.include "modules/comproto/defs.asm"
|
|
||||||
.include "modules/comproto/main.asm"
|
|
||||||
.include "modules/comproto/addr.asm"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_STATS
|
|
||||||
.include "modules/stats/main.asm"
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_OWI_MASTER
|
|
||||||
.include "modules/owimaster/main.asm"
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_DS18B20
|
|
||||||
.include "modules/ds18b20/main.asm"
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_SK6812
|
|
||||||
.include "modules/sk6812/main.asm"
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_MOTION_LIGHT
|
|
||||||
.include "modules/ma_light/main.asm"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
|
||||||
; data in SRAM
|
|
||||||
|
|
||||||
.dseg
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODULES_DS18B20
|
|
||||||
sramDs18b20Timer: .byte 2
|
|
||||||
sramSendDs18b20TempTimer: .byte 2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
|
||||||
; data in FLASH
|
|
||||||
|
|
||||||
.cseg
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; timer list
|
|
||||||
|
|
||||||
|
|
||||||
timerList:
|
|
||||||
; SRAM variable/counter routine flags secs (0=don't start or restart)
|
|
||||||
#ifdef MODULES_COM_WITH_ADDR_PROTO
|
|
||||||
.dw cproAddresModeTimer, CPRO_Address_OnTimer, 0, 0 ; (no restart)
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_STATS
|
|
||||||
.dw statsSendTimer, Stats_Timer, TIMER_FLAGS_IF_ADDR, 9000 ; every 15m
|
|
||||||
#endif
|
|
||||||
#ifdef MODULES_DS18B20
|
|
||||||
.dw sramDs18b20Timer, Ds18b20_OnTimer, 0, 300 ; every 30s
|
|
||||||
.dw sramSendDs18b20TempTimer, sendDs18b20Temp, TIMER_FLAGS_IF_ADDR, 600 ; every 60s
|
|
||||||
#endif
|
|
||||||
.dw 0 ; end of list
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.include "main_all.asm"
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; Called early on system startup. No arguments, no results.
|
|
||||||
|
|
||||||
systemSetSpeed:
|
|
||||||
.if clock == 1000000
|
|
||||||
ldi r16, (1<<CLKPCE)
|
|
||||||
ldi r17, (1<<CLKPS1) | (1<<CLKPS0)
|
|
||||||
out CLKPR, r16
|
|
||||||
out CLKPR, r17
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if clock == 8000000
|
|
||||||
ldi r16, (1<<CLKPCE)
|
|
||||||
ldi r17, 0
|
|
||||||
out CLKPR, r16
|
|
||||||
out CLKPR, r17
|
|
||||||
.endif
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; Called just before rebooting to bootloader. No arguments, no results.
|
|
||||||
|
|
||||||
systemSetBootSpeed:
|
|
||||||
ldi r16, (1<<CLKPCE)
|
|
||||||
ldi r17, (1<<CLKPS1) | (1<<CLKPS0)
|
|
||||||
out CLKPR, r16
|
|
||||||
out CLKPR, r17
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; Called on first time run, i.e. on system start. No arguments, no results.
|
|
||||||
|
|
||||||
onSystemStart:
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODULES_DS18B20
|
|
||||||
sendDs18b20Temp:
|
|
||||||
rcall Ds18b20_SendTemp
|
|
||||||
brcs sendDs18b20Temp_okay
|
|
||||||
; set timer to 1s to retry later
|
|
||||||
ldi xl, LOW(sramSendDs18b20TempTimer)
|
|
||||||
ldi xh, HIGH(sramSendDs18b20TempTimer)
|
|
||||||
rjmp Timer_SetValueTo1s
|
|
||||||
sendDs18b20Temp_okay:
|
|
||||||
ret
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; Called every 100ms. Add your routine calls here. No arguments, no results.
|
|
||||||
|
|
||||||
onEvery100ms:
|
|
||||||
#ifdef MODULES_LED_SIMPLE
|
|
||||||
rcall LedSimple_Every100ms
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MODULES_REED
|
|
||||||
rcall REED_Every100ms
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MODULES_MOTION_LIGHT
|
|
||||||
rcall MotionLight_Every100ms
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; @routine onPacketReceived:
|
|
||||||
;
|
|
||||||
; Called after a packet was received via COM module. Add your routine calls here.
|
|
||||||
;
|
|
||||||
; The packet will be released in any case after return from this call.
|
|
||||||
;
|
|
||||||
; @return CFLAG set if message handled, cleared otherwise
|
|
||||||
; @param X pointer to received buffer
|
|
||||||
; @clobbers all
|
|
||||||
|
|
||||||
onPacketReceived:
|
|
||||||
; get msg code
|
|
||||||
adiw xh:xl, COM2_MSG_OFFS_CMD
|
|
||||||
ld r16, x
|
|
||||||
sbiw xh:xl, COM2_MSG_OFFS_CMD
|
|
||||||
|
|
||||||
#ifdef MODULES_MOTION_LIGHT
|
|
||||||
rcall MotionLight_OnPacketReceived
|
|
||||||
brcs onPacketReceived_end
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MODULES_SK6812
|
|
||||||
rcall SK6812_OnPacketReceived
|
|
||||||
brcs onPacketReceived_end
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MODULES_REED
|
|
||||||
rcall REED_OnPacketReceived
|
|
||||||
brcs onPacketReceived_end
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MODULES_COM
|
|
||||||
rcall CPRO_OnPacketReceived
|
|
||||||
brcs onPacketReceived_end
|
|
||||||
#endif
|
|
||||||
|
|
||||||
clc
|
|
||||||
onPacketReceived_end:
|
|
||||||
ret
|
|
||||||
; @end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
33
avr/devices/n22/main/0BUILD
Normal file
33
avr/devices/n22/main/0BUILD
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml?>
|
||||||
|
|
||||||
|
<gwbuild>
|
||||||
|
|
||||||
|
<target type="AvrHexFile" name="n22_firmware" >
|
||||||
|
|
||||||
|
<includes type="avrasm" >
|
||||||
|
-I $(builddir)
|
||||||
|
-I $(srcdir)
|
||||||
|
-I $(topsrcdir)/avr
|
||||||
|
-I $(topbuilddir)/avr
|
||||||
|
</includes>
|
||||||
|
|
||||||
|
|
||||||
|
<sources type="avrasm" >
|
||||||
|
main.asm
|
||||||
|
</sources>
|
||||||
|
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<subdirs>
|
||||||
|
</subdirs>
|
||||||
|
|
||||||
|
<extradist>
|
||||||
|
</extradist>
|
||||||
|
|
||||||
|
|
||||||
|
</gwbuild>
|
||||||
|
|
||||||
|
|
||||||
186
avr/devices/n22/main/main.asm
Normal file
186
avr/devices/n22/main/main.asm
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
; ***************************************************************************
|
||||||
|
; copyright : (C) 2024 by Martin Preuss
|
||||||
|
; email : martin@libchipcard.de
|
||||||
|
;
|
||||||
|
; ***************************************************************************
|
||||||
|
; * This file is part of the project "AqHome". *
|
||||||
|
; * Please see toplevel file COPYING of that project for license details. *
|
||||||
|
; ***************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
; ***************************************************************************
|
||||||
|
; Source file for LED controller node on AtTiny 85
|
||||||
|
;
|
||||||
|
; This is for the full system (i.e. not the boot loader).
|
||||||
|
; ***************************************************************************
|
||||||
|
|
||||||
|
.equ clock=8000000 ; Define the clock frequency
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.nolist
|
||||||
|
.include "include/tn85def.inc" ; Define device ATtiny85
|
||||||
|
.list
|
||||||
|
|
||||||
|
.include "../defs.asm"
|
||||||
|
;.include "./data.asm"
|
||||||
|
|
||||||
|
.include "devices/all/defs.asm"
|
||||||
|
.include "common/utils_wait.asm"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ***************************************************************************
|
||||||
|
; defines
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; generic
|
||||||
|
|
||||||
|
.equ NET_BUFFERS_NUM = 6
|
||||||
|
.equ NET_BUFFERS_SIZE = 32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; firmware settings including list of modules used
|
||||||
|
|
||||||
|
.equ FIRMWARE_VERSION_MAJOR = 0
|
||||||
|
.equ FIRMWARE_VERSION_MINOR = 0
|
||||||
|
.equ FIRMWARE_VERSION_PATCHLEVEL = 1
|
||||||
|
|
||||||
|
|
||||||
|
#define MODULES_CLOCK
|
||||||
|
#define MODULES_LED_SIMPLE
|
||||||
|
#define MODULES_NETWORK
|
||||||
|
#define MODULES_UART_BITBANG
|
||||||
|
#define MODULES_OWI_MASTER
|
||||||
|
#define MODULES_DS18B20
|
||||||
|
#define MODULES_SK6812
|
||||||
|
;#define MODULES_MOTION_LIGHT
|
||||||
|
|
||||||
|
#define APPS_NETWORK
|
||||||
|
#define APPS_REPORTSENSORS
|
||||||
|
#define APPS_STATS
|
||||||
|
#define APPS_MA_LIGHT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; defines for modules
|
||||||
|
|
||||||
|
;.equ VALUE_ID_SI7021_TEMP = 0x01
|
||||||
|
;.equ VALUE_ID_SI7021_HUM = 0x02
|
||||||
|
|
||||||
|
;.equ VALUE_ID_ADC = 0x03
|
||||||
|
;.equ VALUE_ID_REED1 = 0x04
|
||||||
|
;.equ VALUE_ID_REED2 = 0x05
|
||||||
|
.equ VALUE_ID_DS18B20_TEMP = 0x06
|
||||||
|
|
||||||
|
;.equ VALUE_ID_REED_CONF = 0x81
|
||||||
|
.equ VALUE_ID_LED_NUMLEDS = 0x82
|
||||||
|
.equ VALUE_ID_LED_RGBW_VALUE = 0x83
|
||||||
|
.equ VALUE_ID_MAL_RGBW_VALUE = 0x84
|
||||||
|
.equ VALUE_ID_MAL_ONTIME = 0x85
|
||||||
|
.equ VALUE_ID_MAL_SOURCE1 = 0x86
|
||||||
|
.equ VALUE_ID_MAL_SOURCE2 = 0x87
|
||||||
|
|
||||||
|
|
||||||
|
; ***************************************************************************
|
||||||
|
; code segment
|
||||||
|
|
||||||
|
.cseg
|
||||||
|
.org 000000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; Reset and interrupt vectors
|
||||||
|
|
||||||
|
rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system
|
||||||
|
reti ; EXT_INT0
|
||||||
|
rjmp UART_BitBang_PcintIsr ; PCI0
|
||||||
|
reti ; OC1A
|
||||||
|
reti ; OVF1
|
||||||
|
reti ; OVF0
|
||||||
|
reti ; ERDY
|
||||||
|
reti ; ACI
|
||||||
|
reti ; ADCC
|
||||||
|
reti ; OC1B
|
||||||
|
rjmp baseTimerIrqOC0A ; OC0A
|
||||||
|
reti ; OC0B
|
||||||
|
reti ; WATCHDOG
|
||||||
|
reti ; USI_STR
|
||||||
|
reti ; USI_OVF
|
||||||
|
|
||||||
|
|
||||||
|
devInfoBlock: ; 12 bytes
|
||||||
|
devInfoManufacturer: .db 'A', 'Q', 'U', 'A'
|
||||||
|
devInfoId: .db DEVICEINFO_ID, 0
|
||||||
|
devInfoVersion: .db DEVICEINFO_VERSION, DEVICEINFO_REVISION ; version, revision
|
||||||
|
firmwareVersion: .db FIRMWARE_VARIANT_LEDSTRIPS, FIRMWARE_VERSION_MAJOR
|
||||||
|
.db FIRMWARE_VERSION_MINOR, FIRMWARE_VERSION_PATCHLEVEL
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine firmwareStart @global
|
||||||
|
|
||||||
|
firmwareStart:
|
||||||
|
rjmp main
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine onSystemStart
|
||||||
|
|
||||||
|
onSystemStart:
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine onMessageReceived
|
||||||
|
;
|
||||||
|
; Called on every message received
|
||||||
|
|
||||||
|
onMessageReceived:
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine onEvery100ms
|
||||||
|
;
|
||||||
|
; Called every 100ms. Add your routine calls here. No arguments, no results.
|
||||||
|
|
||||||
|
onEvery100ms:
|
||||||
|
onEverySecond:
|
||||||
|
onEveryMinute:
|
||||||
|
onEveryHour:
|
||||||
|
onEveryDay:
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ***************************************************************************
|
||||||
|
; includes
|
||||||
|
|
||||||
|
.include "devices/all/hw_tn85.asm"
|
||||||
|
.include "devices/all/includes.asm"
|
||||||
|
.include "common/debug.asm"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; defines for network interface
|
||||||
|
|
||||||
|
.equ netInterfaceData = uart_bitbang_iface
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user