Version 1.5.1

Added dynamic memory management for shutters (functions in shutter.c).
Code is now much easier to tailor to specific needs and works better in the limited RAM of routers.
Memory leaks were not found by Valgrind Memcheck.
This commit is contained in:
2021-09-19 12:01:49 +02:00
parent bf6c12a13f
commit b82fb898e9
4 changed files with 60 additions and 30 deletions

View File

@@ -18,6 +18,7 @@ typedef struct shutter {
minitime down; //time of lowering
byte rolltime_down; //measured in seconds, measured when the shutter is rolling down (usually faster than rolling up)
byte percentage; //the percentage to which the shutter is to be lowered
struct shutter *next;
} shutter;
typedef enum buttons {
@@ -27,4 +28,8 @@ typedef enum buttons {
prev,
next
} buttons;
shutter * create_shutter (byte ch, byte rolltime_down);
void append_shutter (shutter **head, shutter *new_shutter);
void free_shutters (shutter * head);
#endif //_SHUTTER_H_