From 34b6bab7113e8d4594f86ea3d413f790fde2d350 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 26 Mar 2026 21:05:06 +0100 Subject: [PATCH] avr: added README --- avr/README | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 avr/README diff --git a/avr/README b/avr/README new file mode 100644 index 0000000..450d88d --- /dev/null +++ b/avr/README @@ -0,0 +1,50 @@ + +AqHome Node Operating System +============================ + +This is a very simple operating system for AVR nodes using ATtiny and ATmega MCUs. + +It doesn't use administration objects in RAM, it just defines some routine calls which +have to be added into the system to add new drivers and modules. + + +The following routine types are defined: + +Function Description required add to file +INIT init module/app yes modules_init.asm or apps_init.asm +RUN called from the main loop no modules_run.asm or apps_run.asm +MSGRECVD called when new messages arrive no modules_msg.asm or apps_msg.asm +EVERY100MS called every 100 millisecs (system timer tick) no modules_100ms.asm or apps_100ms.asm +EVERY1S called every second no modules_1s.asm or apps_1s.asm +EVERY1M called every minute no modules_1m.asm or apps_1m.asm +EVERY1H called every hour no modules_1h.asm or apps_1h.asm +EVERY1D called every day no modules_1d.asm or apps_1d.asm + + +Not all modules implement all those functions. Some modules only need to be called +once every main loop, others need to be called periodically every once in a while. + +If a module implements a function a call to that routine must be inserted into the appropriate +file in "avr/devices/all/". + +In order to make it easier for devices to optionally include modules/apps those calls need to be +between preprocessor directives like in: + +----------------------------------X8 +#ifdef MODULES_DS18B20 + bigcall Ds18b20_OnEverySecond +#endif +----------------------------------X8 + + +This way it is very easy to use a module (like that DS18B20 module) by using the +following line in your main code: + +----------------------------------X8 +#define MODULES_DS18B20 +----------------------------------X8 + +This enables all the function calls for this module. Nothing else needs to be changed in your main +code file in order to enable that module. + +