From e1331d626680771d1047477f17589f27393a1a2e Mon Sep 17 00:00:00 2001
From: marcel
Date: Sun, 21 Jan 2024 16:05:37 +0100
Subject: [PATCH] Buffer overflow windspeed fixed
---
CHANGELOG.md | 10 ++++
build-doc/weather_station.html | 4 +-
build-doc/weather_station.md | 6 +-
datasheet/Handboek_H05_knmi_definities.pdf | Bin 0 -> 490125 bytes
firmware/weather_station.ino | 63 ++++++++++++---------
5 files changed, 51 insertions(+), 32 deletions(-)
create mode 100644 datasheet/Handboek_H05_knmi_definities.pdf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5da7424..24a554b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,3 +41,13 @@ All notable changes to this project will be documented in this file.
- ModBus read register 14: Status bits
- ModBus coil register 0 : enable/disable heather algorithm
+## [0.2.2] - 2023-01-21
+
+### Fixed
+
+- Buffer overflow when calculating average wind speed in AverageOfArray(). Fix: use 32 bit register for average_value.
+
+### Changed
+
+- Changed some variables to the propper standard (uint8_t, uint16_t, etc.)
+- SparkFun wind interrupt now calculates over 3 seconds in stead of 1 second (KNMI standard)]
diff --git a/build-doc/weather_station.html b/build-doc/weather_station.html
index b6b9e35..5097a1a 100644
--- a/build-doc/weather_station.html
+++ b/build-doc/weather_station.html
@@ -745,8 +745,8 @@ units are scaled by a factor of 10 or 100. This way, values with up to
two decimal points can be stored as 16 bit integer values. Just divide
by 10 or 100 to get the floating point values.
Output coils (write only)
-Input registers are numbered 1 to 9999 but have data addresses 0x000
-to 0x270E. The default value of a register is 0.
+Output coils registers are numbered 1 to 9999 but have data addresses
+0x000 to 0x270E. The default value of a register is 0.