src/ChronoChroma/ChronoChroma.cpp
int8_t ChronoChroma::attached() {
  if (EventReceiver::attached()) {
    event_color_shift.repurpose(CHRONOCHROMA_MSG_COLOR_SHF, (EventReceiver*) this);
    event_color_shift.incRefs();
    event_color_shift.specific_target = (EventReceiver*) this;
    event_color_shift.alterSchedulePeriod(30);
    event_color_shift.autoClear(false);
    event_color_shift.alterScheduleRecurrence(-1);
    platform.kernel()->addSchedule(&event_color_shift);

    event_display_refresh.repurpose(CHRONOCHROMA_MSG_DISP_UPDATE, (EventReceiver*) this);
    event_display_refresh.incRefs();
    event_display_refresh.specific_target = (EventReceiver*) this;
    event_display_refresh.alterSchedulePeriod(1000);
    event_display_refresh.autoClear(false);
    event_display_refresh.alterScheduleRecurrence(-1);
    platform.kernel()->addSchedule(&event_display_refresh);
    return 1;
  }
  return 0;
}
/**
* This is called when the kernel attaches the module.
* This is the first time the class can be expected to have kernel access.
*
* @return 0 on no action, 1 on action, -1 on failure.
*/
This is called when the kernel attaches the module.
This is the first time the class can be expected to have kernel access.
This is called when the kernel attaches the module . This is the first time the class can be expected to have kernel access .
int8_t ChronoChroma::attached() {
  if (EventReceiver::attached()) {
    event_color_shift.repurpose(CHRONOCHROMA_MSG_COLOR_SHF, (EventReceiver*) this);
    event_color_shift.incRefs();
    event_color_shift.specific_target = (EventReceiver*) this;
    event_color_shift.alterSchedulePeriod(30);
    event_color_shift.autoClear(false);
    event_color_shift.alterScheduleRecurrence(-1);
    platform.kernel()->addSchedule(&event_color_shift);
    event_display_refresh.repurpose(CHRONOCHROMA_MSG_DISP_UPDATE, (EventReceiver*) this);
    event_display_refresh.incRefs();
    event_display_refresh.specific_target = (EventReceiver*) this;
    event_display_refresh.alterSchedulePeriod(1000);
    event_display_refresh.autoClear(false);
    event_display_refresh.alterScheduleRecurrence(-1);
    platform.kernel()->addSchedule(&event_display_refresh);
    return 1;
  }
  return 0;
}
int8_t ChronoChroma :: attached ( ) { if ( EventReceiver :: attached ( ) ) { event_color_shift . repurpose ( CHRONOCHROMA_MSG_COLOR_SHF , ( EventReceiver * ) this ) ; event_color_shift . incRefs ( ) ; event_color_shift . specific_target = ( EventReceiver * ) this ; event_color_shift . alterSchedulePeriod ( 30 ) ; event_color_shift . autoClear ( false ) ; event_color_shift . alterScheduleRecurrence ( -1 ) ; platform . kernel ( ) -> addSchedule ( & event_color_shift ) ; event_display_refresh . repurpose ( CHRONOCHROMA_MSG_DISP_UPDATE , ( EventReceiver * ) this ) ; event_display_refresh . incRefs ( ) ; event_display_refresh . specific_target = ( EventReceiver * ) this ; event_display_refresh . alterSchedulePeriod ( 1000 ) ; event_display_refresh . autoClear ( false ) ; event_display_refresh . alterScheduleRecurrence ( -1 ) ; platform . kernel ( ) -> addSchedule ( & event_display_refresh ) ; return 1 ; } return 0 ; }
This is called when the kernel attaches the module.
This is called when the kernel attaches the module .