mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-08-21 17:35:06 +00:00
Use AppInstanceId instead of int
This commit is contained in:
parent
bede5f2aef
commit
3275629e9a
@ -1,6 +1,8 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "instance.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -54,7 +56,7 @@ struct AppEvent {
|
|||||||
*/
|
*/
|
||||||
struct AppEventSubscription {
|
struct AppEventSubscription {
|
||||||
/** The app instance this subscription receives events for; set by the caller before app_event_subscribe(). */
|
/** The app instance this subscription receives events for; set by the caller before app_event_subscribe(). */
|
||||||
uint32_t app_instance_id;
|
AppInstanceId app_instance_id;
|
||||||
|
|
||||||
TaskHandle_t task;
|
TaskHandle_t task;
|
||||||
|
|
||||||
@ -89,7 +91,7 @@ error_t app_event_unsubscribe(struct AppEventSubscription* sub);
|
|||||||
* @retval ERROR_RESOURCE at least one matching subscription's queue was full; the event was
|
* @retval ERROR_RESOURCE at least one matching subscription's queue was full; the event was
|
||||||
* dropped for that subscription (still delivered to any other matching subscription)
|
* dropped for that subscription (still delivered to any other matching subscription)
|
||||||
*/
|
*/
|
||||||
error_t app_event_emit(uint32_t app_instance_id, const struct AppEvent* event);
|
error_t app_event_emit(AppInstanceId app_instance_id, const struct AppEvent* event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pop the next event for @a sub, blocking up to @a timeout if the queue is currently empty.
|
* Pop the next event for @a sub, blocking up to @a timeout if the queue is currently empty.
|
||||||
|
|||||||
@ -50,7 +50,7 @@ error_t app_event_unsubscribe(AppEventSubscription* sub) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_t app_event_emit(uint32_t app_instance_id, const AppEvent* event) {
|
error_t app_event_emit(AppInstanceId app_instance_id, const AppEvent* event) {
|
||||||
AppEvent stamped_event = *event;
|
AppEvent stamped_event = *event;
|
||||||
stamped_event.timestamp = get_micros_since_boot();
|
stamped_event.timestamp = get_micros_since_boot();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user