Skip to main content

pamoja_duty_cycle_from_fraction

Function pamoja_duty_cycle_from_fraction 

Source
#[unsafe(no_mangle)]
pub extern "C" fn pamoja_duty_cycle_from_fraction( period_us: u64, fraction: f32, ) -> PamojaDutyCycle
Expand description

Creates a duty cycle that spends a fraction of each period awake.

§Arguments

  • period_us - the whole period, in microseconds.
  • fraction - the share of the period spent awake, clamped to 0.0 through 1.0.

§Returns

The duty cycle.