LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_sch_api.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
17
33#ifndef JUNO_SCH_API_H
34#define JUNO_SCH_API_H
35#include "juno/app/app_api.h"
36#include "juno/status.h"
37#include "juno/module.h"
38#include "juno/time/time_api.h"
39#include "juno/types.h"
40#ifdef __cplusplus
41extern "C"
42{
43#endif
44
46
47typedef struct JUNO_SCH_ROOT_TAG JUNO_SCH_ROOT_T;
48
56#define JUNO_SCH_TABLE_NEW(ptArrName, zAppsPerMinorFrame, zNumMinorFrames, ...) \
57JUNO_APP_ROOT_T *ptArrName[zNumMinorFrames * zAppsPerMinorFrame] = {__VA_ARGS__}
58
60struct JUNO_SCH_ROOT_TAG JUNO_MODULE_ROOT(JUNO_SCH_API_T,
61 JUNO_TIME_ROOT_T *ptTime;
62 JUNO_APP_ROOT_T **ptArrSchTable;
63 size_t zAppsPerMinorFrame;
64 size_t zNumMinorFrames;
65 JUNO_TIMESTAMP_T tMinorFramePeriod;
66);
67
69{
73 JUNO_TIMESTAMP_RESULT_T (*GetMinorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch);
75 JUNO_TIMESTAMP_RESULT_T (*GetMajorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch);
76};
77
78#ifdef __cplusplus
79}
80#endif
81#endif // JUNO_SCH_API_H
Application module API (start/process/exit lifecycle).
struct JUNO_APP_ROOT_TAG JUNO_APP_ROOT_T
The application module.
Definition app_api.h:50
#define JUNO_MODULE_ROOT(API_T,...)
Implement a module root struct containing ptApi and failure fields.
Definition module.h:126
int32_t JUNO_STATUS_T
Canonical status type for LibJuno functions.
Definition status.h:49
struct JUNO_TIME_ROOT_TAG JUNO_TIME_ROOT_T
Definition time_api.h:69
struct JUNO_SCH_ROOT_TAG JUNO_SCH_ROOT_T
Definition juno_sch_api.h:47
Module system and dependency injection primitives for LibJuno.
Status codes and failure-handling helpers for LibJuno.
Definition juno_sch_api.h:69
JUNO_TIMESTAMP_RESULT_T(* GetMajorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch)
Compute the major frame period (minor * count).
Definition juno_sch_api.h:75
JUNO_TIMESTAMP_RESULT_T(* GetMinorFramePeriod)(JUNO_SCH_ROOT_T *ptJunoSch)
Get the configured minor frame period.
Definition juno_sch_api.h:73
JUNO_STATUS_T(* Execute)(JUNO_SCH_ROOT_T *ptJunoSch)
Run the scheduler for one major frame.
Definition juno_sch_api.h:71
Timestamp consisting of whole seconds and fixed-point subseconds.
Definition time_api.h:105
Juno Time module API and common time math helpers.
Common module result type aliases used throughout LibJuno.