[Grbl_Esp32 PR#483] Fix double-enabled probrem

未分类 bolang 4个月前 (10-14) 50次浏览

Issue #483 | 状态: 已关闭 | 作者: odaki | 创建时间: 2020-07-18


I found a bug in a feature definition script I wrote.
If you explicitly specify enable for a feature that has already been defined, it is doubly enabled.

Before fix:
bash:
% ./configure-features.py -v -e WIFI -e BLUETOOTH -e SD_CARD
Config path: /Users/odaki/Documents/GitHub/GrblEsp32/GrblEsp32/config.h

#define ENABLE_BLUETOOTH // enable bluetooth

#define ENABLESDCARD // enable use of SD Card to run jobs

#define ENABLE_WIFI //enable wifi

#if defined(ENABLEWIFI) || defined(ENABLEBLUETOOTH)
#define WIFIORBLUETOOTH
#endif

#define ENABLE_HTTP //enable HTTP and all related services
#define ENABLE_OTA //enable OTA
#define ENABLE_TELNET //enable telnet
#define ENABLETELNETWELCOME_MSG //display welcome string when connect to telnet
#define ENABLE_MDNS //enable mDNS discovery
#define ENABLE_SSDP //enable UPNP discovery
#define ENABLE_NOTIFICATIONS //enable notifications

#define ENABLESERIAL2SOCKETIN
#define ENABLESERIAL2SOCKETOUT

// Captive portal is used when WiFi is in access point mode. It lets the
// WebUI come up automatically in the browser, instead of requiring the user
// to browse manually to a default URL. It works like airport and hotel
// WiFi that takes you a special page as soon as you connect to that AP.
#define ENABLECAPTIVEPORTAL

// Warning! The current authentication implementation is too weak to provide
// security against an attacker, since passwords are stored and transmitted
// "in the clear" over unsecured channels. It should be treated as a
// "friendly suggestion" to prevent unwitting dangerous actions, rather than
// as effective security against malice.
//#define ENABLE_AUTHENTICATION
#define ENABLESDCARD
`
"ENABLESDCARD" is double-enabled(See the last line).

After fix:
`bash:
% ./configure-features.py -v -e WIFI -e BLUETOOTH -e SD_CARD
Config path: /Users/odaki/Documents/GitHub/GrblEsp32/GrblEsp32/config.h

#define ENABLE_BLUETOOTH // enable bluetooth

#define ENABLESDCARD // enable use of SD Card to run jobs

#define ENABLE_WIFI //enable wifi

#if defined(ENABLEWIFI) || defined(ENABLEBLUETOOTH)
#define WIFIORBLUETOOTH
#endif

#define ENABLE_HTTP //enable HTTP and all related services
#define ENABLE_OTA //enable OTA
#define ENABLE_TELNET //enable telnet
#define ENABLETELNETWELCOME_MSG //display welcome string when connect to telnet
#define ENABLE_MDNS //enable mDNS discovery
#define ENABLE_SSDP //enable UPNP discovery
#define ENABLE_NOTIFICATIONS //enable notifications

#define ENABLESERIAL2SOCKETIN
#define ENABLESERIAL2SOCKETOUT

// Captive portal is used when WiFi is in access point mode. It lets the
// WebUI come up automatically in the browser, instead of requiring the user
// to browse manually to a default URL. It works like airport and hotel
// WiFi that takes you a special page as soon as you connect to that AP.
#define ENABLECAPTIVEPORTAL

// Warning! The current authentication implementation is too weak to provide
// security against an attacker, since passwords are stored and transmitted
// "in the clear" over unsecured channels. It should be treated as a
// "friendly suggestion" to prevent unwitting dangerous actions, rather than
// as effective security against malice.
//#define ENABLE_AUTHENTICATION
%

Now, “ENABLESDCARD” has been defined only once.

Please merge the modified code with the PR.

原始Issue: https://github.com/bdring/Grbl_Esp32/pull/483

喜欢 (0)