Merge pull request #615 from jg1uaa/master

permit inline comment and hex-value to ScreenLayout of Nextion
This commit is contained in:
Jonathan Naylor 2020-07-02 13:20:20 +01:00 committed by GitHub
commit 5dcdfd8159
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -390,6 +390,9 @@ bool CConf::read()
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
value[len - 1U] = '\0';
value++;
} else {
// if value is not quoted, remove after # (to make comment)
strtok(value, "#");
}
if (section == SECTION_GENERAL) {
@ -916,7 +919,7 @@ bool CConf::read()
else if (::strcmp(key, "IdleBrightness") == 0)
m_nextionIdleBrightness = (unsigned int)::atoi(value);
else if (::strcmp(key, "ScreenLayout") == 0)
m_nextionScreenLayout = (unsigned int)::atoi(value);
m_nextionScreenLayout = (unsigned int)::strtoul(value, NULL, 0);
else if (::strcmp(key, "DisplayTempInFahrenheit") == 0)
m_nextionTempInFahrenheit = ::atoi(value) == 1;
} else if (section == SECTION_OLED) {