@@ -113,7 +113,7 @@ BBIO_err initialize_pwm(void)
113113 return BBIO_OK ;
114114 }
115115
116- syslog (LOG_INFO , "initialize_pwm: OK" );
116+ syslog (LOG_INFO , "Adafruit_BBIO: initialize_pwm: OK" );
117117 return BBIO_OK ;
118118}
119119
@@ -558,7 +558,7 @@ BBIO_err pwm_setup(const char *key, __attribute__ ((unused)) float duty, __attri
558558
559559BBIO_err pwm_start (const char * key , float duty , float freq , int polarity )
560560{
561- syslog (LOG_DEBUG , "pwm_start: %s, %f, %f, %i" , key , duty , freq , polarity );
561+ syslog (LOG_DEBUG , "Adafruit_BBIO: pwm_start: %s, %f, %f, %i" , key , duty , freq , polarity );
562562
563563 BBIO_err err ;
564564 char buffer [20 ];
@@ -619,24 +619,24 @@ BBIO_err pwm_start(const char *key, float duty, float freq, int polarity)
619619
620620 // Initialize pwm->duty to avoid weirdness
621621 pwm -> duty = duty ;
622- fprintf ( stderr , "pwm_set_frequency()\n" );
622+ syslog ( LOG_DEBUG , "Adafruit_BBIO: pwm_start: call pwm_set_frequency(key=%s freq=%f)" , key , freq );
623623 err = pwm_set_frequency (key , freq );
624624 if (err != BBIO_OK ) {
625625 syslog (LOG_ERR , "Adafruit_BBIO: pwm_start: %s couldn't set duty frequency: %i" , key , err );
626626 return err ;
627627 }
628628
629- fprintf ( stderr , "pwm_set_duty_cycle()\n" );
629+ syslog ( LOG_DEBUG , "Adafruit_BBIO: pwm_start: call pwm_set_duty_cycle(key=%s duty=%f)" , key , duty );
630630 err = pwm_set_duty_cycle (key , duty );
631631 if (err != BBIO_OK ) {
632632 syslog (LOG_ERR , "Adafruit_BBIO: pwm_start: %s couldn't set duty cycle: %i" , key , err );
633633 return err ;
634634 }
635635
636- fprintf ( stderr , "pwm_set_polarity()\n" );
636+ syslog ( LOG_DEBUG , "Adafruit_BBIO: pwm_start: call pwm_set_polarity(key=%s polarity=%d)" , key , polarity );
637637 err = pwm_set_polarity (key , polarity );
638638 if (err != BBIO_OK ) {
639- syslog (LOG_ERR , "pwm_start: %s couldn't set polarity: %i" , key , err );
639+ syslog (LOG_ERR , "Adafruit_BBIO: pwm_start: %s couldn't set polarity: %i" , key , err );
640640 return err ;
641641 }
642642
@@ -645,7 +645,7 @@ BBIO_err pwm_start(const char *key, float duty, float freq, int polarity)
645645 return BBIO_GEN ;
646646 }
647647 len = snprintf (buffer , sizeof (buffer ), "1" );
648- fprintf ( stderr , "write 1 to pwm->enable_fd\n" );
648+ syslog ( LOG_DEBUG , "Adafruit_BBIO: pwm_start: write( pwm->enable_fd, buffer=%s, len=%d)" , buffer , len );
649649 lseek (pwm -> enable_fd , 0 , SEEK_SET );
650650 if (write (pwm -> enable_fd , buffer , len ) < 0 ) {
651651 syslog (LOG_ERR , "Adafruit_BBIO: pwm_start: %s couldn't write enable: %i-%s" ,
0 commit comments