瀏覽代碼

#263 Add PWM to Makefile

pull/270/head
mstroh76 2 月之前
父節點
當前提交
725336332e
共有 2 個檔案被更改,包括 8 行新增5 行删除
  1. +4
    -4
      wiringPi/test/Makefile
  2. +4
    -1
      wiringPi/test/wiringpi_test9_pwm.c

+ 4
- 4
wiringPi/test/Makefile 查看文件

@@ -2,13 +2,13 @@ CC = gcc
CFLAGS = -Wall CFLAGS = -Wall
LDFLAGS = LDFLAGS =


# Need BCM26 <-> BCM19 connected (1kOhm)
tests = wiringpi_test1_sysfs wiringpi_test2_sysfs wiringpi_test3_device_wpi wiringpi_test4_device_phys wiringpi_test5_default wiringpi_test6_isr wiringpi_test7_version
# Need BCM19 <-> BCM26, +PWM: BCM12 <-> BCM13, BCM18 <-> BCM17 connected (1kOhm)
tests = wiringpi_test1_sysfs wiringpi_test2_sysfs wiringpi_test3_device_wpi wiringpi_test4_device_phys wiringpi_test5_default wiringpi_test6_isr wiringpi_test7_version wiringpi_test9_pwm


# Need XO hardware # Need XO hardware
xotests = wiringpi_xotest_test1_spi wiringpi_i2c_test1_pcf8574
xotests = wiringpi_xotest_test1_spi wiringpi_i2c_test1_pcf8574 wiringpi_test9_pwm


# Need PiFace hardware and tests condition
# Need PiFace hardware and BCM23 <-> BCM24 , BCM18 <-> BCM17 connected (1kOhm), and PiFace Out7<->In4, Out6<->In5, R0_NO<->In6, R0_NO<->In7, R_C<-100Ohm->GND
pifacetests = wiringpi_piface_test1 wiringpi_test9_pwm pifacetests = wiringpi_piface_test1 wiringpi_test9_pwm


all: $(tests) $(xotests) $(pifacetests) all: $(tests) $(xotests) $(pifacetests)


+ 4
- 1
wiringPi/test/wiringpi_test9_pwm.c 查看文件

@@ -141,7 +141,7 @@ int main (void) {
return UnitTestState(); return UnitTestState();
} }
printf("Wait for start ...\n"); printf("Wait for start ...\n");
delay(250);
delay(500);
printf("Start:\n"); printf("Start:\n");
//MeasureAndCheckFreq("50\% Duty (default)", 300.000); //FAIL , freq (pwmc=32) to high for irq count //MeasureAndCheckFreq("50\% Duty (default)", 300.000); //FAIL , freq (pwmc=32) to high for irq count


@@ -215,5 +215,8 @@ int main (void) {
printf("set PWM@GPIO%d (output) back to input\n", PWM); printf("set PWM@GPIO%d (output) back to input\n", PWM);
pinMode(PWM, INPUT); pinMode(PWM, INPUT);
} }

printf("\nDid %d PWM GPIO tests with model %d\n", testruns, RaspberryPiModel);

return UnitTestState(); return UnitTestState();
} }

Loading…
取消
儲存