mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
formatting
This commit is contained in:
@@ -54,7 +54,7 @@ bool PButton::init(uint8_t pin, bool pullMode) {
|
|||||||
|
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
pinMode(pin_, pullMode ? INPUT_PULLUP : INPUT_PULLDOWN);
|
pinMode(pin_, pullMode ? INPUT_PULLUP : INPUT_PULLDOWN);
|
||||||
#else // esp8266 and standalone
|
#else // esp8266 and standalone
|
||||||
pinMode(pin_, pullMode ? INPUT_PULLUP : INPUT);
|
pinMode(pin_, pullMode ? INPUT_PULLUP : INPUT);
|
||||||
#endif
|
#endif
|
||||||
enabled_ = (digitalRead(pin_) == pullMode); // see if a button is connected
|
enabled_ = (digitalRead(pin_) == pullMode); // see if a button is connected
|
||||||
|
|||||||
@@ -47,21 +47,21 @@ class PButton {
|
|||||||
bool pullMode_;
|
bool pullMode_;
|
||||||
bool enabled_;
|
bool enabled_;
|
||||||
|
|
||||||
bool state_; // Value read from button
|
bool state_; // Value read from button
|
||||||
bool lastState_; // Last value of button state
|
bool lastState_; // Last value of button state
|
||||||
bool dblClickWaiting_; // whether we're waiting for a double click (down)
|
bool dblClickWaiting_; // whether we're waiting for a double click (down)
|
||||||
bool dblClickOnNextUp_; // whether to register a double click on next release, or whether to wait and click
|
bool dblClickOnNextUp_; // whether to register a double click on next release, or whether to wait and click
|
||||||
bool singleClickOK_; // whether it's OK to do a single click
|
bool singleClickOK_; // whether it's OK to do a single click
|
||||||
|
|
||||||
uint32_t downTime_; // time the button was pressed down
|
uint32_t downTime_; // time the button was pressed down
|
||||||
uint32_t upTime_; // time the button was released
|
uint32_t upTime_; // time the button was released
|
||||||
|
|
||||||
bool ignoreUP_; // whether to ignore the button release because the click+hold was triggered
|
bool ignoreUP_; // whether to ignore the button release because the click+hold was triggered
|
||||||
bool waitForUP_; // when held, whether to wait for the up event
|
bool waitForUP_; // when held, whether to wait for the up event
|
||||||
bool longPressHappened_; // whether or not the hold event happened already
|
bool longPressHappened_; // whether or not the hold event happened already
|
||||||
bool vLongPressHappened_; // whether or not the long hold event happened already
|
bool vLongPressHappened_; // whether or not the long hold event happened already
|
||||||
|
|
||||||
bool buttonBusy_; // false if idle
|
bool buttonBusy_; // false if idle
|
||||||
|
|
||||||
buttonEventHandler cb_onClick, cb_onDblClick, cb_onLongPress, cb_onVLongPress;
|
buttonEventHandler cb_onClick, cb_onDblClick, cb_onLongPress, cb_onVLongPress;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
namespace uuid {
|
namespace uuid {
|
||||||
|
|
||||||
// added by proddy for EMS-ESP
|
|
||||||
static uint64_t now_millis = 0;
|
static uint64_t now_millis = 0;
|
||||||
|
|
||||||
// returns system uptime in seconds
|
// returns system uptime in seconds
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
namespace uuid {
|
namespace uuid {
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
set_uptime(); // added by proddy
|
set_uptime();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace uuid
|
} // namespace uuid
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ void loop();
|
|||||||
*/
|
*/
|
||||||
uint64_t get_uptime_ms();
|
uint64_t get_uptime_ms();
|
||||||
|
|
||||||
uint32_t get_uptime(); // added by proddy for EMS-ESP
|
uint32_t get_uptime();
|
||||||
uint32_t get_uptime_sec(); // added by proddy for EMS-ESP
|
uint32_t get_uptime_sec();
|
||||||
|
|
||||||
void set_uptime();
|
void set_uptime();
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ void Shell::display_prompt() {
|
|||||||
std::string context = context_text();
|
std::string context = context_text();
|
||||||
|
|
||||||
print(prompt_prefix());
|
print(prompt_prefix());
|
||||||
// colors added by proddy
|
|
||||||
if (!hostname.empty()) {
|
if (!hostname.empty()) {
|
||||||
print(COLOR_BRIGHT_GREEN);
|
print(COLOR_BRIGHT_GREEN);
|
||||||
print(COLOR_BOLD_ON);
|
print(COLOR_BOLD_ON);
|
||||||
@@ -78,7 +77,6 @@ void Shell::display_prompt() {
|
|||||||
print(COLOR_BOLD_ON);
|
print(COLOR_BOLD_ON);
|
||||||
print(context);
|
print(context);
|
||||||
print(COLOR_RESET);
|
print(COLOR_RESET);
|
||||||
// print(' ');
|
|
||||||
}
|
}
|
||||||
print(prompt_suffix());
|
print(prompt_suffix());
|
||||||
print(' ');
|
print(' ');
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ bool SyslogService::can_transmit() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!emsesp::EMSESP::system_.network_connected()) {
|
if (!emsesp::EMSESP::system_.network_connected()) {
|
||||||
return false; // added by proddy. Check Ethernet
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint64_t now = uuid::get_uptime_ms();
|
const uint64_t now = uuid::get_uptime_ms();
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ class File : public Stream {
|
|||||||
bool seek(uint32_t pos) {
|
bool seek(uint32_t pos) {
|
||||||
return seek(pos, SeekSet);
|
return seek(pos, SeekSet);
|
||||||
}
|
}
|
||||||
size_t position() const;
|
size_t position() const;
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
bool setBufferSize(size_t size);
|
bool setBufferSize(size_t size);
|
||||||
void close();
|
void close();
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
time_t getLastWrite();
|
time_t getLastWrite();
|
||||||
const char * path() const;
|
const char * path() const;
|
||||||
const char * name() const;
|
const char * name() const;
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class Stream : public Print {
|
|||||||
// initial characters that are not digits (or the minus sign) are skipped
|
// initial characters that are not digits (or the minus sign) are skipped
|
||||||
// integer is terminated by the first character that is not a digit.
|
// integer is terminated by the first character that is not a digit.
|
||||||
|
|
||||||
float parseFloat(); // float version of parseInt
|
float parseFloat(); // float version of parseInt
|
||||||
|
|
||||||
virtual size_t readBytes(char * buffer, size_t length) // read chars from stream into buffer
|
virtual size_t readBytes(char * buffer, size_t length) // read chars from stream into buffer
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user