#include <Arduino.h>
#include "FastPin.h"
// FastPin(const uint8_t pin, const uint8_t mode, const bool active_low = false);
//FastPin button(18, INPUT_PULLUP, true);
//FastPin led(17, OUTPUT);
FastPin* button = nullptr;
FastPin* led = nullptr;
const uint32_t _reg = GPIO_OUT_W1TS_REG;
const uint32_t _bit = BIT17;
void setup()
{
Serial.begin(115200);
button = new FastPin(18, INPUT_PULLUP, true);
led = new FastPin(17, OUTPUT);
button->set_debounce(500000);
}
void loop()
{ uint32_t start = millis();
for (size_t i = 0; i < 1000000; i++) {
//REG_WRITE(GPIO_OUT_W1TS_REG, BIT17); //231
//REG_WRITE(_reg, _bit); //231 const-tal
led->high(); // 462
//led.on(); // 694
//button->read(); //231
//button.state(); //231
//button.debounced_read(); //809
//button.debounced_state(); //809
/*if (button->debounced_state())//2195-1733
led->on();
else
led->off();*/
//led->write(button->debounced_state());//2217-1733
}
uint32_t delta = millis() - start;
Serial.println(delta);
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1