Commit 312af853 authored by virtualabs's avatar virtualabs
Browse files

Fixed a bug in BMA423 driver and began adding support twatch v2.

- Added a Kconfig file to allow the user to select the version of T-Watch to use
- Added an error message in BMA423 driver
parent e7dd6d69
menu "T-Watch Lib"
choice TWATCH_VERSION
prompt "Target T-Watch version"
default TWATCH_V1
config TWATCH_V1
bool "T-Watch 2020 v1"
config TWATCH_V2
bool "T-Watch 2020 v2"
endchoice
endmenu
......@@ -97,6 +97,12 @@ esp_err_t bma_init(void)
if (BMA4_OK == bma4_set_int_pin_config(&config, BMA4_INTR1_MAP, &_dev))
return ESP_OK;
/* Write device feature config file. */
if (bma423_write_config_file(&_dev) != BMA4_OK)
{
ESP_LOGI(TAG, "bma423_init FAIL: cannot write config file");
}
/* Failure. */
return ESP_FAIL;
}
......@@ -260,7 +266,7 @@ void bma_attachInterrupt()
rslt |= bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT, BMA4_ENABLE, &_dev);
rslt |= bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_TILT_INT, BMA4_ENABLE, &_dev);
bma423_anymotion_enable_axis(BMA423_ALL_AXIS_DIS, &_dev);
bma423_anymotion_enable_axis(BMA423_ALL_AXIS_EN, &_dev);
}
bool bma_set_remap_axes(struct bma423_axes_remap *remap_data)
......
......@@ -17,7 +17,13 @@
#define ST7789_SPI_SCLK_IO GPIO_NUM_18
#define ST7789_SPI_CS_IO GPIO_NUM_5
#define ST7789_SPI_DC_IO GPIO_NUM_27
#define ST7789_BL_IO GPIO_NUM_12
#ifdef CONFIG_TWATCH_V1
#define ST7789_BL_IO GPIO_NUM_12
#elif CONFIG_TWATCH_V2
#define ST7789_BL_IO GPIO_NUM_25
#endif
#define ST7789_SPI_SPEED /*80000000L*/SPI_MASTER_FREQ_80M
#define ST779_PARALLEL_LINES 80
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment