Skip to content

Commit f4fcd12

Browse files
author
Matthew West
committed
Move a common variable out of #ifdef and #else
1 parent 149129c commit f4fcd12

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

source/c_pwm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ BBIO_err pwm_set_duty_cycle(const char *key, float duty) {
275275
BBIO_err pwm_setup(const char *key, float duty, float freq, int polarity)
276276
{
277277
BBIO_err err;
278+
struct pwm_exp *new_pwm;
278279

279280
#ifdef BBBVERSION41
280281
char pwm_dev_path[45]; // "/sys/devices/platform/ocp/48300000.epwmss"
@@ -289,7 +290,6 @@ BBIO_err pwm_setup(const char *key, float duty, float freq, int polarity)
289290

290291
int e;
291292
int period_fd, duty_fd, polarity_fd, enable_fd;
292-
struct pwm_exp *new_pwm;
293293
struct stat s;
294294
FILE *f = NULL;
295295
pwm_t *p;
@@ -384,7 +384,6 @@ BBIO_err pwm_setup(const char *key, float duty, float freq, int polarity)
384384
char period_path[50];
385385
char polarity_path[55];
386386
int period_fd, duty_fd, polarity_fd;
387-
struct pwm_exp *new_pwm;
388387

389388
if (!pwm_initialized) {
390389
err = initialize_pwm();

0 commit comments

Comments
 (0)