mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-10-30 02:12:41 +01:00
Fix OBPFormatter when course values > 360° were shown as e.g. 370° instead of 010°
This commit is contained in:
1 parent
58a0bbf0d4
commit
6c6557f54e
1 file changed
+2
-1
@@ -3,6 +3,7 @@
|
||||
#include <Arduino.h>
|
||||
#include "GwApi.h"
|
||||
#include "Pagedata.h"
|
||||
#include "OBPDataOperations.h"
|
||||
|
||||
// ToDo
|
||||
// simulation data
|
||||
@@ -219,7 +220,7 @@ FormattedData formatValue(GwApi::BoatValue *value, CommonData &commondata, bool
|
||||
course = M_PI_2 + float(random(-17, 17) / 100.0); // create random course/wind values with 90° +/- 10°
|
||||
rawvalue = course;
|
||||
}
|
||||
course = course * RAD_TO_DEG; // Unit conversion form rad to deg
|
||||
course = WindUtils::to360(course * RAD_TO_DEG); // Unit conversion form rad to deg
|
||||
|
||||
// Format 3 numbers with prefix zero
|
||||
snprintf(buffer,bsize,"%03.0f",course);
|
||||
|
||||
Reference in new issue
Block a user