OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [lib/] [source/] [neorv32_pwm.c] - Diff between revs 12 and 35

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 12 Rev 35
Line 103... Line 103...
  uint32_t duty_new  = (uint32_t)duty;
  uint32_t duty_new  = (uint32_t)duty;
 
 
  duty_mask = duty_mask << (channel * 8);
  duty_mask = duty_mask << (channel * 8);
  duty_new  = duty_new  << (channel * 8);
  duty_new  = duty_new  << (channel * 8);
 
 
  PWM_DUTY &= ~duty_mask; // clear previous duty cycle
  uint32_t duty_cycle = PWM_DUTY;
  PWM_DUTY |= duty_new; // set new duty cycle
 
 
  duty_cycle &= ~duty_mask; // clear previous duty cycle
 
  duty_cycle |= duty_new; // set new duty cycle
 
 
 
  PWM_DUTY = duty_cycle;
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.