return get_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO]);
}
-static int am335xgpio_blink(int on)
+static int am335xgpio_blink(bool on)
{
if (is_gpio_config_valid(&adapter_gpio_config[ADAPTER_GPIO_IDX_LED]))
- set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_LED], on);
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_LED], on ? 1 : 0);
return ERROR_OK;
}
}
}
-static int bcm2835gpio_blink(int on)
+static int bcm2835gpio_blink(bool on)
{
if (is_gpio_config_valid(ADAPTER_GPIO_IDX_LED))
- set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_LED], on);
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_LED], on ? 1 : 0);
return ERROR_OK;
}
retval = ERROR_OK;
if (bitbang_interface->blink) {
- if (bitbang_interface->blink(1) != ERROR_OK)
+ if (bitbang_interface->blink(true) != ERROR_OK)
return ERROR_FAIL;
}
cmd = cmd->next;
}
if (bitbang_interface->blink) {
- if (bitbang_interface->blink(0) != ERROR_OK)
+ if (bitbang_interface->blink(false) != ERROR_OK)
return ERROR_FAIL;
}
{
if (bitbang_interface->blink) {
/* FIXME: we should manage errors */
- bitbang_interface->blink(1);
+ bitbang_interface->blink(true);
}
for (unsigned int i = offset; i < bit_cnt + offset; i++) {
if (bitbang_interface->blink) {
/* FIXME: we should manage errors */
- bitbang_interface->blink(0);
+ bitbang_interface->blink(false);
}
}
int (*write)(int tck, int tms, int tdi);
/** Blink led (optional). */
- int (*blink)(int on);
+ int (*blink)(bool on);
/** Sample SWDIO and return the value. */
int (*swdio_read)(void);
return ERROR_OK;
}
-static int dummy_led(int on)
+static int dummy_led(bool on)
{
return ERROR_OK;
}
return ERROR_OK;
}
-static int linuxgpiod_blink(int on)
+static int linuxgpiod_blink(bool on)
{
int retval;
if (!is_gpio_config_valid(ADAPTER_GPIO_IDX_LED))
return ERROR_OK;
- retval = gpiod_line_set_value(gpiod_line[ADAPTER_GPIO_IDX_LED], on);
+ retval = gpiod_line_set_value(gpiod_line[ADAPTER_GPIO_IDX_LED], on ? 1 : 0);
if (retval < 0)
LOG_WARNING("Fail set led");
return retval;
return ERROR_OK;
}
-/* turn LED on parport adapter on (1) or off (0) */
-static int parport_led(int on)
+/* turn LED on parport adapter on (true) or off (true) */
+static int parport_led(bool on)
{
if (on)
dataport_value |= cable->LED_MASK;
return ERROR_FAIL;
if (parport_write(0, 0, 0) != ERROR_OK)
return ERROR_FAIL;
- if (parport_led(1) != ERROR_OK)
+ if (parport_led(true) != ERROR_OK)
return ERROR_FAIL;
bitbang_interface = &parport_bitbang;
static int parport_quit(void)
{
- if (parport_led(0) != ERROR_OK)
+ if (parport_led(false) != ERROR_OK)
return ERROR_FAIL;
if (parport_exit) {
return remote_bitbang_flush();
}
-static int remote_bitbang_blink(int on)
+static int remote_bitbang_blink(bool on)
{
char c = on ? 'B' : 'b';
return remote_bitbang_queue(c, FLUSH_SEND_BUF);