diff --git a/avr/devices/all/0BUILD b/avr/devices/all/0BUILD index 106eb17..d06b95e 100644 --- a/avr/devices/all/0BUILD +++ b/avr/devices/all/0BUILD @@ -6,6 +6,8 @@ apps.asm data.asm defs.asm + hw_tn84.asm + hw_tn85.asm includes.asm main.asm modules.asm diff --git a/avr/devices/all/apps.asm b/avr/devices/all/apps.asm index 2dedf5f..efbd423 100644 --- a/avr/devices/all/apps.asm +++ b/avr/devices/all/apps.asm @@ -37,6 +37,13 @@ initApps: rcall AppDoor_Init #endif +#ifdef APPS_REPORTSENSORS + rcall AppReportSensors_Init +#endif + +#ifdef APPS_STATS + rcall AppStats_Init +#endif ; done ret ; @end diff --git a/avr/devices/all/hw_tn84.asm b/avr/devices/all/hw_tn84.asm new file mode 100644 index 0000000..cdb1436 --- /dev/null +++ b/avr/devices/all/hw_tn84.asm @@ -0,0 +1,65 @@ +; *************************************************************************** +; copyright : (C) 2025 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. * +; *************************************************************************** + +; Hardware routine for AtTiny 84 devices + + +.cseg + + +; --------------------------------------------------------------------------- +; @routine systemInitHardware +; + +systemInitHardware: + ; set all ports as inputs and enable internal pull-up resistors + ldi r16, 0xff + clr r17 +.ifdef PORTA + out DDRA, r17 ; all input + out PORTA, r16 ; enable pull-up on all +.endif + +.ifdef PORTB + out DDRB, r17 ; all input + out PORTB, r16 ; enable pull-up on all +.endif + +.ifdef PORTC + out DDRC, r17 ; all input + out PORTC, r16 ; enable pull-up on all +.endif + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine systemSetSpeed +; + +systemSetSpeed: +.if clock == 8000000 + ldi r16, (1<