Browse Source

Update wiringPi/wiringPi.c

Line 529,530: An obvious writing mistake, code don't match comment.
pull/7/head
shamiao 12 years ago
parent
commit
2146c868fa
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      wiringPi/wiringPi.c

+ 2
- 2
wiringPi/wiringPi.c View File

@@ -526,8 +526,8 @@ void pinModeGpio (int pin, int mode)
*(clk + PWMCLK_CNTL) = BCM_PASSWORD | 0x01 ; // Stop PWM Clock *(clk + PWMCLK_CNTL) = BCM_PASSWORD | 0x01 ; // Stop PWM Clock
delayMicroseconds (110) ; // See comments in pwmSetClockWPi delayMicroseconds (110) ; // See comments in pwmSetClockWPi


(void)*(pwm + PWM_CONTROL) ;
while ((*(pwm + PWM_CONTROL) & 0x80) != 0) // Wait for clock to be !BUSY
(void)*(clk + PWMCLK_CNTL) ;
while ((*(clk + PWMCLK_CNTL) & 0x80) != 0) // Wait for clock to be !BUSY
delayMicroseconds (1) ; delayMicroseconds (1) ;


*(clk + PWMCLK_DIV) = BCM_PASSWORD | (32 << 12) ; // set pwm div to 32 (19.2/32 = 600KHz) *(clk + PWMCLK_DIV) = BCM_PASSWORD | (32 << 12) ; // set pwm div to 32 (19.2/32 = 600KHz)


Loading…
Cancel
Save