Repository navigation
feat(api): _DEFINE macros for every M2 object type (M2 leftover) - #43
Merged
Merged
Conversation
The deferred cross-type change of A40: EMB_SEM_DEFINE, EMB_MUTEX_DEFINE, EMB_EVENT_DEFINE, EMB_COND_DEFINE, EMB_MSGQ_DEFINE (with its ring), EMB_WORKQ_DEFINE (with its stack) and EMB_TIMER_DEFINE declare storage and the handle. Each registers an init-table wrapper that constructs the object in emb_kernel_init(), as EMB_THREAD_DEFINE does (API-021, KRN-OBJ-009). The macros take positional fields because a partial attribute initializer would zero fields whose defaults are not zero. EMB_TIMER_DEFINE covers interrupt-context timers only. Table entries, the system work queue's included, run in link order, and EMB_INIT_AFTER does not exist yet. Object names are kept only where CONFIG_EMB_OBJ_NAMES keeps them. One conformance case per type checks construction in the init table. A64 records the contract. Signed-off-by: teo1747 <motsoujunior17@gmail.com>
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contains the time-slicing commit as its base: merge the time-slicing PR first, after which this diff shows only the
_DEFINEchange.This is the cross-type
_DEFINEchange deferred in A40 (API-021, KRN-OBJ-009). Each macro declares storage and the handle, and registers an init-table wrapper that constructs the object inemb_kernel_init(), asEMB_THREAD_DEFINEdoes. A construction failure faults throughemb_check_status().EMB_SEM_DEFINEEMB_MUTEX_DEFINEEMB_EVENT_DEFINEEMB_COND_DEFINEEMB_MSGQ_DEFINEEMB_WORKQ_DEFINEEMB_TIMER_DEFINEA64 records the contract:
EMB_INIT_AFTERdoes not exist yet, so such a timer is constructed in code (SPEC-009 §5.2 already says so).CONFIG_EMB_OBJ_NAMES, so AVR does not copy the literals to RAM.Evidence
*_define_constructs_in_init_tableconformance case per type.Docs
API-021, SPEC-001 §6.4, SPEC-009 §5.2, the synchronization guide and CHANGELOG.