Browse Source

Debugging

v0.9.5
Guy Turcotte 2 years ago
parent
commit
b51d51bd33
  1. 3
      README.md
  2. 2
      include/drivers/inkplate_platform.hpp
  3. 7
      include/drivers/touch_screen.hpp
  4. 2
      src/drivers/inkplate_platform.cpp
  5. 6
      src/drivers/touch_screen.cpp
  6. 2
      src/services/network_client.cpp
  7. 11
      test/touch_screen/sdkconfig

3
README.md

@ -1,10 +1,11 @@
# ESP-IDF-InkPlate Library Version 0.9.5
(May, 20, 2021)
(July, 15, 2021)
(Not ready yet...)
Version 0.9.5:
- Corrected issue with PlatformIO Espressif32 version 3.3.0 (wifi_interface_t vs esp_interface_t)
- Added InkPlate-6PLUS support: Screen, Touch Screen, Front Light. `INKPLATE_6PLUS` must be defined to compile for this device. For the TouchScreen class, TouchPositions has been defined as an array of 2 entries to minimize the potential of bad methods parameters.
- Some code refactoring in drivers.
- I2C speed lowered to 100Khz instead of 1Mhz (Wire class). This to respect I2C hardware limitation related to the PullUp resistors in used with Inkplate devices.

2
include/drivers/inkplate_platform.hpp

@ -111,7 +111,7 @@ class InkPlatePlatform : NonCopyable
* @return false - Some device not initialized properly
*/
#if defined(INKPLATE_6PLUS)
bool setup(bool sd_card_init = false, void (*touch_screen_handler)(void *) = nullptr);
bool setup(bool sd_card_init = false, TouchScreen::ISRHandlerPtr touch_screen_handler = nullptr);
#else
bool setup(bool sd_card_init = false);
#endif

7
include/drivers/touch_screen.hpp

@ -2,6 +2,7 @@
#if defined(INKPLATE_6PLUS)
#include "inkplate_platform.hpp"
#include "non_copyable.hpp"
#include "mcp23017.hpp"
@ -12,11 +13,13 @@ class TouchScreen : NonCopyable
public:
TouchScreen(MCP23017 & _mcp) : mcp(_mcp), ready(false) {}
typedef void (* ISRHandlerPtr)();
static const gpio_num_t INTERRUPT_PIN = GPIO_NUM_36;
typedef std::array<uint16_t, 2> TouchPositions;
bool setup(bool power_on, uint16_t scr_width, uint16_t scr_height, void (*isr_handler)(void * arg) = nullptr);
bool setup(bool power_on, uint16_t scr_width, uint16_t scr_height, ISRHandlerPtr isr_handler = nullptr);
void shutdown();
bool is_screen_touched();
@ -27,7 +30,7 @@ class TouchScreen : NonCopyable
bool is_ready() { return ready; }
void set_app_isr_handler(void (*isr_handler)(void * arg));
void set_app_isr_handler(ISRHandlerPtr isr_handler);
private:
static constexpr char const * TAG = "TouchScreen";

2
src/drivers/inkplate_platform.cpp

@ -15,7 +15,7 @@ InkPlatePlatform InkPlatePlatform::singleton;
bool
#if defined(INKPLATE_6PLUS)
InkPlatePlatform::setup(bool sd_card_init, void (*touch_screen_handler)(void *))
InkPlatePlatform::setup(bool sd_card_init, TouchScreen::ISRHandlerPtr touch_screen_handler)
#else
InkPlatePlatform::setup(bool sd_card_init)
#endif

6
src/drivers/touch_screen.cpp

@ -6,7 +6,7 @@
#include "driver/gpio.h"
static void (* app_isr_handler)(void * arg);
static ISRHandlerPtr app_isr_handler;
static volatile bool touchscreen_interrupt_happened = false;
static void IRAM_ATTR
@ -18,7 +18,7 @@ touchscreen_isr(void * value)
}
bool
TouchScreen::setup(bool power_on, uint16_t scr_width, uint16_t scr_height, void (*isr_handler)(void * arg))
TouchScreen::setup(bool power_on, uint16_t scr_width, uint16_t scr_height, ISRHandlerPtr isr_handler)
{
ready = false;
touchscreen_interrupt_happened = false;
@ -67,7 +67,7 @@ TouchScreen::setup(bool power_on, uint16_t scr_width, uint16_t scr_height, void
}
void
TouchScreen::set_app_isr_handler(void (*isr_handler)(void * arg))
TouchScreen::set_app_isr_handler(ISRHandlerPtr isr_handler)
{
gpio_intr_disable(INTERRUPT_PIN);
app_isr_handler = isr_handler;

2
src/services/network_client.cpp

@ -134,7 +134,7 @@ NetworkClient::joinAP(const char * ssid, const char * pass)
wifi_config.sta.password[sizeof(wifi_config.sta.password) - 1] = 0;
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config));
ESP_ERROR_CHECK(esp_wifi_set_config((wifi_interface_t)ESP_IF_WIFI_STA, &wifi_config));
ESP_ERROR_CHECK(esp_wifi_start());
ESP_LOGI(TAG, "wifi_init_sta finished.");

11
test/touch_screen/sdkconfig

@ -196,6 +196,12 @@ CONFIG_SPI_MASTER_ISR_IN_IRAM=y
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
# end of SPI configuration
#
# TWAI configuration
#
# CONFIG_TWAI_ISR_IN_IRAM is not set
# end of TWAI configuration
#
# UART configuration
#
@ -703,6 +709,7 @@ CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
#
# TCP
#
CONFIG_LWIP_TCP_ISN_HOOK=y
CONFIG_LWIP_MAX_ACTIVE_TCP=16
CONFIG_LWIP_MAX_LISTENING_TCP=16
CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y
@ -888,6 +895,7 @@ CONFIG_MDNS_TASK_AFFINITY_CPU0=y
# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set
CONFIG_MDNS_TASK_AFFINITY=0x0
CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000
# CONFIG_MDNS_STRICT_MODE is not set
CONFIG_MDNS_TIMER_PERIOD_MS=100
# end of mDNS
@ -956,6 +964,7 @@ CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y
CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y
CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20
CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1
# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set
#
# Auto-detect flash chips
@ -964,6 +973,8 @@ CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y
CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y
CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y
# end of Auto-detect flash chips
CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y
# end of SPI Flash driver
#

Loading…
Cancel
Save