14 changed files with 144 additions and 19 deletions
-
22README.md
-
2app/config/sdk_config.h
-
4app/src/basic_service/device_state.c
-
4app/src/basic_service/device_state.h
-
6app/src/basic_service/device_version_info_mgr.c
-
15app/src/board/ads129x/ads129x.c
-
4app/src/board/ads129x/ads129x.h
-
1app/src/board/app_board.c
-
37app/src/main.c
-
2app/src/one_conduction_main.c
-
18app/src/service/heart_wave_sample_service/heart_wave_sample_service.c
-
29bak/zapp_timer.c
-
17bak/zapp_timer.h
-
2libznordic
@ -0,0 +1,29 @@ |
|||
#include "zapp_timer.h" |
|||
|
|||
static void app_timer_timeout_handler(void* p_context) { // |
|||
zapp_timer_context* zcontext = (zapp_timer_context*)p_context; |
|||
ZASSERT(zcontext != NULL); |
|||
ZASSERT(zcontext->mark = 0xAABBCCDD); |
|||
|
|||
if (zcontext->timeout_handler) zcontext->timeout_handler(zcontext->usrcontext); |
|||
} |
|||
|
|||
ret_code_t zapp_timer_create(zapp_timer_context* context, // |
|||
app_timer_id_t* p_timer_id, app_timer_mode_t mode, app_timer_timeout_handler_t timeout_handler) { |
|||
context->timeout_handler = timeout_handler; |
|||
context->mark = 0xAABBCCDD; |
|||
ret_code_t ret = app_timer_create(p_timer_id, mode, app_timer_timeout_handler); |
|||
if (ret != NRF_SUCCESS) { |
|||
return ret; |
|||
} |
|||
(*p_timer_id)->p_context = context; |
|||
return ret; |
|||
} |
|||
|
|||
ret_code_t zapp_timer_start(app_timer_id_t timer_id, uint32_t timeout_ticks, void* p_context) { // |
|||
zapp_timer_context* zcontext = (zapp_timer_context*)timer_id->p_context; |
|||
ZASSERT(zcontext != NULL); |
|||
ZASSERT(zcontext->mark = 0xAABBCCDD); |
|||
zcontext->usrcontext = p_context; |
|||
return app_timer_start(timer_id, timeout_ticks, zcontext); |
|||
} |
@ -0,0 +1,17 @@ |
|||
#pragma once |
|||
#include <stdbool.h> |
|||
#include <stdint.h> |
|||
|
|||
#include "znordic.h" |
|||
|
|||
typedef void (*app_event_listener_t)(void* p_event_data, uint16_t event_size); |
|||
|
|||
typedef struct { |
|||
uint32_t mark; |
|||
app_timer_timeout_handler_t timeout_handler; |
|||
void* usrcontext; |
|||
} zapp_timer_context; |
|||
|
|||
ret_code_t zapp_timer_create(zapp_timer_context* context, // |
|||
app_timer_id_t const* p_timer_id, app_timer_mode_t mode, app_timer_timeout_handler_t timeout_handler); |
|||
ret_code_t zapp_timer_start(app_timer_id_t timer_id, uint32_t timeout_ticks, void* p_context); |
@ -1 +1 @@ |
|||
Subproject commit 01225055c1cbd6e6b3bc50a5f084d4e515063512 |
|||
Subproject commit 30b93787c0e760b623df1656c3002ed742f1fff8 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue