change pca9685 channel range(0 ~ 15)
authorJeonghoon Park <jh1979.park@samsung.com>
Mon, 18 Dec 2017 07:42:42 +0000 (16:42 +0900)
committerJeonghoon Park <jh1979.park@samsung.com>
Mon, 18 Dec 2017 07:42:42 +0000 (16:42 +0900)
src/resource/resource_PCA9685.c
src/resource/resource_servo_motor.c

index e8b6275..20a5545 100644 (file)
@@ -150,7 +150,7 @@ int resource_pca9685_init(unsigned int ch)
        uint8_t mode1 = 0;
        int ret = PERIPHERAL_ERROR_NONE;
 
-       if (ch == 0 || ch > PCA9685_CH_MAX) {
+       if (ch > PCA9685_CH_MAX) {
                _E("channel[%u] is out of range", ch);
                return -1;
        }
index 512cc5b..e16df2e 100644 (file)
@@ -50,7 +50,7 @@ void resource_close_servo_motor_all(void)
 {
        unsigned int i;
 
-       for (i = 1; i <= SERVO_MOTOR_MAX; i++)
+       for (i = ; i <= SERVO_MOTOR_MAX; i++)
                resource_close_servo_motor(i);
 
        return;
@@ -60,9 +60,6 @@ int resource_set_servo_motor_value(unsigned int motor_id, int value)
 {
        int ret = 0;
 
-       if (motor_id == 0)
-               return -1;
-
        if (motor_id > SERVO_MOTOR_MAX)
                return -1;