Convert Arduino boolean to bool (#2042)

This commit is contained in:
Jesse Hills 2021-07-20 15:31:54 +12:00 committed by GitHub
parent 71d9d64a02
commit 7619507e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

@ -116,7 +116,7 @@ DFPLAYER_SIMPLE_ACTION(PreviousAction, previous)
template<typename... Ts> class PlayFileAction : public Action<Ts...>, public Parented<DFPlayer> { template<typename... Ts> class PlayFileAction : public Action<Ts...>, public Parented<DFPlayer> {
public: public:
TEMPLATABLE_VALUE(uint16_t, file) TEMPLATABLE_VALUE(uint16_t, file)
TEMPLATABLE_VALUE(boolean, loop) TEMPLATABLE_VALUE(bool, loop)
void play(Ts... x) override { void play(Ts... x) override {
auto file = this->file_.value(x...); auto file = this->file_.value(x...);
@ -133,7 +133,7 @@ template<typename... Ts> class PlayFolderAction : public Action<Ts...>, public P
public: public:
TEMPLATABLE_VALUE(uint16_t, folder) TEMPLATABLE_VALUE(uint16_t, folder)
TEMPLATABLE_VALUE(uint16_t, file) TEMPLATABLE_VALUE(uint16_t, file)
TEMPLATABLE_VALUE(boolean, loop) TEMPLATABLE_VALUE(bool, loop)
void play(Ts... x) override { void play(Ts... x) override {
auto folder = this->folder_.value(x...); auto folder = this->folder_.value(x...);

View File

@ -220,8 +220,7 @@ static const uint8_t PROGMEM
// clang-format on // clang-format on
static const char *const TAG = "st7735"; static const char *const TAG = "st7735";
ST7735::ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, boolean eightbitcolor, ST7735::ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, bool eightbitcolor, bool usebgr) {
boolean usebgr) {
model_ = model; model_ = model;
this->width_ = width; this->width_ = width;
this->height_ = height; this->height_ = height;

View File

@ -37,7 +37,7 @@ class ST7735 : public PollingComponent,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING, public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
spi::DATA_RATE_8MHZ> { spi::DATA_RATE_8MHZ> {
public: public:
ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, boolean eightbitcolor, boolean usebgr); ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, bool eightbitcolor, bool usebgr);
void dump_config() override; void dump_config() override;
void setup() override; void setup() override;
@ -75,8 +75,8 @@ class ST7735 : public PollingComponent,
ST7735Model model_{ST7735_INITR_18BLACKTAB}; ST7735Model model_{ST7735_INITR_18BLACKTAB};
uint8_t colstart_ = 0, rowstart_ = 0; uint8_t colstart_ = 0, rowstart_ = 0;
boolean eightbitcolor_ = false; bool eightbitcolor_ = false;
boolean usebgr_ = false; bool usebgr_ = false;
int16_t width_ = 80, height_ = 80; // Watch heap size int16_t width_ = 80, height_ = 80; // Watch heap size
GPIOPin *reset_pin_{nullptr}; GPIOPin *reset_pin_{nullptr};