Skip to content

TimeEvent_ctor question #4

@marcosCapistrano

Description

@marcosCapistrano
void TimeEvent_ctor(TimeEvent * const me, Signal sig, Active *act) {
    /* no critical section because it is presumed that all TimeEvents
     * are created *before* multitasking has started.
     */
    me->super.sig = sig;
    me->act = act;

    /* Create a timer object */
    me->timer = xTimerCreateStatic("TE", 1U, me->type, me,
                                   TimeEvent_callback, &me->timer_cb);
    configASSERT(me->timer);            /* timer must be created */
}

Im not well versed on C so forgive me if this is a dumb question,

  • since the constructor does not accept a type, how would we set it to anything different?
  • wouldn't not initializing it explicitly possibly cause problems if the type isnt zero by default? (when using malloc for example)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions