mirror of
https://github.com/jam422470459/EPD-nRF52-hema213.git
synced 2025-12-06 16:42:49 +08:00
send time on init
This commit is contained in:
@@ -87,6 +87,13 @@ static void epd_update_display_mode(ble_epd_t * p_epd, display_mode_t mode)
|
||||
}
|
||||
}
|
||||
|
||||
static void epd_send_time(ble_epd_t * p_epd)
|
||||
{
|
||||
char buf[20] = {0};
|
||||
snprintf(buf, 20, "t=%"PRIu32, timestamp());
|
||||
ble_epd_string_send(p_epd, (uint8_t *)buf, strlen(buf));
|
||||
}
|
||||
|
||||
static void epd_service_on_write(ble_epd_t * p_epd, uint8_t * p_data, uint16_t length)
|
||||
{
|
||||
NRF_LOG_DEBUG("[EPD]: on_write LEN=%d\n", length);
|
||||
@@ -121,6 +128,7 @@ static void epd_service_on_write(ble_epd_t * p_epd, uint8_t * p_data, uint16_t l
|
||||
epd_config_write(&p_epd->config);
|
||||
}
|
||||
p_epd->epd = epd_init((epd_model_id_t)id);
|
||||
epd_send_time(p_epd);
|
||||
} break;
|
||||
|
||||
case EPD_CMD_CLEAR:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#ifndef __EPD_SERVICE_H
|
||||
#define __EPD_SERVICE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include "ble.h"
|
||||
#include "ble_srv_common.h"
|
||||
|
||||
Reference in New Issue
Block a user