Merge branch 'master' into rolling

This commit is contained in:
CaCO3
2022-11-25 16:49:34 +01:00
committed by GitHub
11 changed files with 204 additions and 135 deletions

View File

@@ -269,8 +269,7 @@ private:
std::unique_ptr< Rgb[] > _secondBuffer;
Rgb *_buffer;
SemaphoreHandle_t _finishedFlag;
// xSemaphoreHandle _finishedFlag;
xSemaphoreHandle _finishedFlag;
int _pixelPosition;
int _componentPosition;

View File

@@ -955,7 +955,7 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st
zw = std::string(archive_filename);
ESP_LOGD(TAG, "Rohfilename: %s", zw.c_str());
if (getFileType(zw) == "BIN")
if (toUpper(zw) == "FIRMWARE.BIN")
{
zw = _target_bin + zw;
ret = zw;

View File

@@ -415,7 +415,7 @@ string ClassFlowControll::GetPrevalue(std::string _number)
std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string _numbers, bool _extern)
{
double zw;
float zw;
char* p;
_newvalue = trim(_newvalue);
@@ -427,7 +427,7 @@ std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string
}
else
{
zw = strtod(_newvalue.c_str(), &p);
zw = strtof(_newvalue.c_str(), &p);
if (zw == 0)
return "- Error in String to Value Conversion!!! Must be of format value=123.456";
}

View File

@@ -56,7 +56,6 @@ std::string ClassFlowPostProcessing::GetJSON(std::string _id, std::string _mac,
else
json += " \"value\": \"\"," + _lineend;
json += " \"raw\": \"" + NUMBERS[i]->ReturnRawValue + "\"," + _lineend;
json += " \"pre\": \"" + NUMBERS[i]->ReturnPreValue + "\"," + _lineend;
json += " \"error\": \"" + NUMBERS[i]->ErrorMessageText + "\"," + _lineend;
if (NUMBERS[i]->ReturnRateValue.length() > 0)
json += " \"rate\": " + NUMBERS[i]->ReturnRateValue + "," + _lineend;
@@ -103,7 +102,7 @@ void ClassFlowPostProcessing::SetPreValue(double zw, string _numbers, bool _exte
if (NUMBERS[j]->name == _numbers)
{
NUMBERS[j]->PreValue = zw;
NUMBERS[j]->ReturnPreValue = RundeOutput(zw, NUMBERS[j]->Nachkomma);
NUMBERS[j]->ReturnPreValue = std::to_string(zw);
NUMBERS[j]->PreValueOkay = true;
if (_extern)
{

View File

@@ -1,3 +1,2 @@
manifest_hash: 4e37bb0f9273c4de05f38688720fe32aa6e5b892452694a4f7a2ca1659f02cf6
target: esp32
manifest_hash: 45994dbfed009907994c31f6d279c5861a1eacbf219ce8b58e74e39b3393816a
version: 1.0.0

View File

@@ -121,8 +121,6 @@ bool Init_NVS_SDCard()
void task_NoSDBlink(void *pvParameter)
{
// esp_rom_gpio_pad_select_gpio(BLINK_GPIO);
gpio_pad_select_gpio(BLINK_GPIO);
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);

View File

@@ -13,12 +13,14 @@
src_dir = main
[env:esp32cam]
;platform = espressif32@4.4.0
platform = espressif32@5.2.0
platform = espressif32@4.4.0
;platform = espressif32@5.1.0
;platform = espressif32
board = esp32cam
;board = m5stack-core-esp32
framework = espidf
;board_build.partitions = partitions_singleapp.csv
board_build.partitions = partitions.csv
lib_deps =

View File

@@ -0,0 +1,107 @@
#include <unity.h>
#include <ClassFlowCNNGeneral.h>
class UnderTestCNN : public ClassFlowCNNGeneral {
public:
using ClassFlowCNNGeneral::ZeigerEvalAnalogNeu;
using ClassFlowCNNGeneral::ZeigerEvalHybridNeu;
using ClassFlowCNNGeneral::ClassFlowCNNGeneral;
};
/**
* @brief test if all combinations of digit
* evaluation are running correctly
*/
void test_ZeigerEval()
{
UnderTestCNN undertest = UnderTestCNN(nullptr, Digital100);
// the 5.2 is already above 5.0 and the previous digit too (3)
printf("Test 5.2, 3\n");
int result = undertest.ZeigerEvalAnalogNeu(5.2, 3);
TEST_ASSERT_EQUAL(5, result);
// the 5.2 is already above 5.0 and the previous digit not (9)
// so the current digit shoult be reduced (4.9)
printf("Test 5.2, 9\n");
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalAnalogNeu(5.2, 9));
printf("Test 4.4, 9\n");
// the 4.4 (digital100) is not above 5 and the previous digit (analog) too (9.3)
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalAnalogNeu(4.4, 9));
printf("Test 4.5, 0\n");
// the 4.5 (digital100) is not above 5 and the previous digit (analog) too (9.6)
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalAnalogNeu(4.5, 0));
}
/**
* @brief test if all combinations of digit
* evaluation are running correctly
*/
void test_ZeigerEvalHybrid() {
UnderTestCNN undertest = UnderTestCNN(nullptr, Digital100);
// the 5.2 and no previous should round down
printf("ZeigerEvalHybridNeu(5.2, 0, -1)\n");
TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.2, 0, -1));
// the 5.3 and no previous should trunc to 5
printf("ZeigerEvalHybridNeu(5.3, 0, -1)\n");
TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.3, 0, -1));
printf("ZeigerEvalHybridNeu(5.7, 0, -1)\n");
// the 5.7 and no previous should trunc to 5
TEST_ASSERT_EQUAL(6, undertest.ZeigerEvalHybridNeu(5.7, 0, -1));
// the 5.8 and no previous should round up to 6
printf("ZeigerEvalHybridNeu(5.8, 0, -1)\n");
TEST_ASSERT_EQUAL(6, undertest.ZeigerEvalHybridNeu(5.8, 0, -1));
// the 5.7 with previous and the previous between 0.3-0.5 should round up to 6
TEST_ASSERT_EQUAL(6, undertest.ZeigerEvalHybridNeu(5.7, 0.4, 1));
// the 5.3 with previous and the previous between 0.3-0.7 should round down to 5
TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.3, 0.7, 1));
// the 5.3 with previous and the previous <=0.5 should trunc to 5
TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.3, 0.1, 1));
// the 5.3 with previous and the previous >=9.5 should reduce to 4
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(5.3, 9.6, 9));
// the 5.7 with previous and the previous >=9.5 should trunc to 5
TEST_ASSERT_EQUAL(5, undertest.ZeigerEvalHybridNeu(5.7, 9.6, 9));
// the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.6)
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.5, 9.6, 0));
// the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.6)
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.5, 9.6, 9));
// the 4.5 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5)
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.5, 9.5, 9));
// 59.96889 - Pre: 58.94888
// 8.6 : 9.8 : 6.7
// the 4.4 (digital100) is not above 5 and the previous digit (analog) not over Zero (9.5)
TEST_ASSERT_EQUAL(8, undertest.ZeigerEvalHybridNeu(8.6, 9.8, 9));
// pre = 9.9 (0.0 raw)
// zahl = 1.8
TEST_ASSERT_EQUAL(2, undertest.ZeigerEvalHybridNeu(1.8, 9.0, 9));
// if a digit have an early transition and the pointer is < 9.0
// prev (pointer) = 6.2, but on digital readout = 6.0 (prev is int parameter)
// zahl = 4.6
TEST_ASSERT_EQUAL(4, undertest.ZeigerEvalHybridNeu(4.6, 6.0, 6));
// issue #879 vorgaenger is -1, zahl = 6.7
//TEST_ASSERT_EQUAL(7, undertest.ZeigerEvalHybrid(6.7, -1.0, -1));
}

View File

@@ -122,4 +122,4 @@ extern "C" void app_main()
RUN_TEST(test_getReadoutRawString);
UNITY_END();
}
}