Events BeforeNewSpeed, AfterNewSpeed

Timed components that depend on the microcontroller clock such as timers, communication and conversion components, may support speed modes defined in the processor component (in EXPERT view level). The event BeforeNewSpeed is invoked before the speed mode changes and AfterNewSpeed is invoked after the speed mode changes. Speed mode may be changed using the processor component methods SetHigh, SetLow, or SetSlow.

  EVENT.C
  int changing_speed_mode = 0;
  void B1_BeforeNewSpeed(void)

  {
      ++changing_speed_mode;
  }
  
  void B1_AfterNewSpeed(void)

  {

   --changing_speed_mode;

  }

  
Note: If the speed mode is not supported by the component, the component functionality is disabled, as if the method Disable is used. If the supported speed mode is selected again, the component status is restored.