mirror of
https://github.com/clockworkpi/WiringPi.git
synced 2025-12-12 16:08:49 +01:00
Keeping compatibility of hardware clock of Pi 4 with earlier versions.
This commit is contained in:
parent
1f908c5eed
commit
651136a110
@ -1218,6 +1218,11 @@ void pwmSetRange (unsigned int range)
|
|||||||
void pwmSetClock (int divisor)
|
void pwmSetClock (int divisor)
|
||||||
{
|
{
|
||||||
uint32_t pwm_control ;
|
uint32_t pwm_control ;
|
||||||
|
|
||||||
|
if (piGpioBase == GPIO_PERI_BASE_2711)
|
||||||
|
{
|
||||||
|
divisor = 540*divisor/192;
|
||||||
|
}
|
||||||
divisor &= 4095 ;
|
divisor &= 4095 ;
|
||||||
|
|
||||||
if ((wiringPiMode == WPI_MODE_PINS) || (wiringPiMode == WPI_MODE_PHYS) || (wiringPiMode == WPI_MODE_GPIO))
|
if ((wiringPiMode == WPI_MODE_PINS) || (wiringPiMode == WPI_MODE_PHYS) || (wiringPiMode == WPI_MODE_GPIO))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user