mirror of
https://github.com/pengwon/epd42.git
synced 2025-12-17 17:28:15 +08:00
send epd config on connect
This commit is contained in:
@@ -60,7 +60,7 @@ static void epd_config_load(epd_config_t *cfg)
|
||||
static void epd_config_save(epd_config_t *cfg)
|
||||
{
|
||||
nrf_nvmc_page_erase(BLE_EPD_CONFIG_ADDR);
|
||||
nrf_nvmc_write_words(BLE_EPD_CONFIG_ADDR, (uint32_t*)cfg, sizeof(epd_config_t) / sizeof(uint32_t));
|
||||
nrf_nvmc_write_bytes(BLE_EPD_CONFIG_ADDR, (uint8_t*)cfg, sizeof(epd_config_t) / sizeof(uint8_t));
|
||||
}
|
||||
|
||||
/**@brief Function for handling the @ref BLE_GAP_EVT_CONNECTED event from the S110 SoftDevice.
|
||||
@@ -178,6 +178,7 @@ static void on_write(ble_epd_t * p_epd, ble_evt_t * p_ble_evt)
|
||||
if (ble_srv_is_notification_enabled(p_evt_write->data))
|
||||
{
|
||||
p_epd->is_notification_enabled = true;
|
||||
ble_epd_string_send(p_epd, (uint8_t *)&p_epd->config, sizeof(epd_config_t));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
/**< EPD Service Configs */
|
||||
typedef struct
|
||||
{
|
||||
uint32_t mosi_pin;
|
||||
uint32_t sclk_pin;
|
||||
uint32_t cs_pin;
|
||||
uint32_t dc_pin;
|
||||
uint32_t rst_pin;
|
||||
uint32_t busy_pin;
|
||||
uint32_t bs_pin;
|
||||
uint32_t driver_id;
|
||||
uint8_t mosi_pin;
|
||||
uint8_t sclk_pin;
|
||||
uint8_t cs_pin;
|
||||
uint8_t dc_pin;
|
||||
uint8_t rst_pin;
|
||||
uint8_t busy_pin;
|
||||
uint8_t bs_pin;
|
||||
uint8_t driver_id;
|
||||
} epd_config_t;
|
||||
|
||||
/**< EPD Service command IDs. */
|
||||
|
||||
Reference in New Issue
Block a user