better buttons

This commit is contained in:
2025-03-03 23:32:22 +01:00
parent 125e1fe42f
commit 23782417af
2 changed files with 6 additions and 6 deletions

View File

@@ -24,11 +24,11 @@ public:
private:
SMD();
static inline spi_device_interface_config_t _devcfg = {
.mode = 0, // SPI mode 0
.clock_speed_hz = 10 * 1000 * 1000, // Clock out at 10 MHz
.spics_io_num = SPI_DISP_CS, // CS pin
.mode = 0, // SPI mode 0
.clock_speed_hz = 2 * 1000 * 1000, // Clock out at 10 MHz
.spics_io_num = SPI_DISP_CS, // CS pin
.flags = SPI_DEVICE_POSITIVE_CS,
.queue_size = 7, // We want to be able to queue 7 transactions at a time
.queue_size = 3,
// .pre_cb = lcd_spi_pre_transfer_callback, //Specify pre-transfer callback to handle D/C line
};
static constexpr size_t kLineBytes = DISP_WIDTH / 8;

View File

@@ -66,11 +66,11 @@ extern "C" void app_main() {
tty.fmt("{:.1f}mA {:.1f}V {:.1f}mAh {}", BatMon::get().get_current(), BatMon::get().get_voltage(),
BatMon::get().get_charge(), slow ? "S" : "");
uint8_t pressed = Buttons::get().get_pressed();
if (pressed & L1)
if (pressed & L3)
rx -= 5;
if (pressed & L4)
ry += 5;
if (pressed & R1)
if (pressed & R3)
ry -= 5;
if (pressed & R4)
rx += 5;