Skip to content

Commit c09ab8e

Browse files
committed
fix pwm on pocketbeagle and beaglebone blue #286
pocketbeagle and beaglebone blue have complete dtb file and do not need overlays
1 parent b1ee599 commit c09ab8e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

source/c_pwm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ BBIO_err pwm_setup(const char *key, __attribute__ ((unused)) float duty, __attri
338338

339339
// Make sure that one of the universal capes is loaded
340340
if( !uboot_overlay_enabled() // only check kernel overlays if u-boot overlays are not being used
341+
&&
342+
!beaglebone_blue() // beaglebone blue has complete dtb file and does not need overlays
343+
&&
344+
!pocketbeagle() // pocketbeagle has complete dtb file and does not need overlays
341345
&&
342346
!( device_tree_loaded("cape-univ-audio") // from cdsteinkuehler/beaglebone-universal-io
343347
|| device_tree_loaded("cape-univ-emmc") // ""
@@ -583,6 +587,7 @@ BBIO_err pwm_setup(const char *key, __attribute__ ((unused)) float duty, __attri
583587
BBIO_err pwm_start(const char *key, float duty, float freq, int polarity)
584588
{
585589
syslog(LOG_DEBUG, "Adafruit_BBIO: pwm_start: %s, %f, %f, %i", key, duty, freq, polarity);
590+
fprintf(stderr, "Adafruit_BBIO: pwm_start: %s, %f, %f, %i\n", key, duty, freq, polarity);
586591

587592
BBIO_err err;
588593
char buffer[20];

source/common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,13 +717,13 @@ int device_tree_loaded(const char *name)
717717

718718
/* beaglebone blue has complete dtb file and does not need overlays */
719719
if(beaglebone_blue()) {
720-
fprintf(stderr, "common.c: load_device_tree(): beaglebone_blue(): TRUE\n");
720+
fprintf(stderr, "common.c: device_tree_loaded(): beaglebone_blue(): TRUE\n");
721721
return BBIO_OK;
722722
}
723723

724724
/* pocketbeagle has complete dtb file and does not need overlays */
725725
if(pocketbeagle()) {
726-
fprintf(stderr, "common.c: load_device_tree(): pocketbeagle(): TRUE\n");
726+
fprintf(stderr, "common.c: device_tree_loaded(): pocketbeagle(): TRUE\n");
727727
return BBIO_OK;
728728
}
729729

@@ -767,13 +767,13 @@ BBIO_err unload_device_tree(const char *name)
767767

768768
/* beaglebone blue has complete dtb file and does not need overlays */
769769
if(beaglebone_blue()) {
770-
fprintf(stderr, "common.c: load_device_tree(): beaglebone_blue(): TRUE\n");
770+
fprintf(stderr, "common.c: unload_device_tree(): beaglebone_blue(): TRUE\n");
771771
return BBIO_OK;
772772
}
773773

774774
/* pocketbeagle has complete dtb file and does not need overlays */
775775
if(pocketbeagle()) {
776-
fprintf(stderr, "common.c: load_device_tree(): pocketbeagle(): TRUE\n");
776+
fprintf(stderr, "common.c: unload_device_tree(): pocketbeagle(): TRUE\n");
777777
return BBIO_OK;
778778
}
779779

0 commit comments

Comments
 (0)