<div dir="ltr"><div><div><div><div><div><div>Hi again guys,<br></div>I've noticed an unexpected (to me) behavior in the GPIO API for Beaglebone Black.<br><br></div>I borrowed a periodic task from the clock test source, and set it up to toggle the GPIOs once every couple seconds.. here's what I have:<br><br>rtems_task Test_task(<br>  rtems_task_argument task_index<br>)<br>{<br>  int task_count = 0;<br>  rtems_time_of_day time;<br>  rtems_interval    ticks;<br>  <br>  ticks = task_index * 2 * rtems_clock_get_ticks_per_second();<br><br>  for ( ; ; ) {<br>    task_count++;<br>    (void) rtems_clock_get_tod( &time );<br>    if ( time.second >= 35 ) {<br>      puts( "*** END OF CLOCK TICK TEST ***" );<br>      //exit( 0 );<br>      while(1);<br>    }<br>    put_name( Task_name[ task_index ], FALSE );<br>    print_time( " - rtems_clock_get_tod - ", &time, "\n" );<br>    <br>    //Toggle GPIO<br>    if(task_count & 1) {<br>        rtems_gpio_set(LED1);<br>        rtems_gpio_set(LED2);<br>        } <br>    else rtems_gpio_clear(LED1);<br>    <br>    (void) rtems_task_wake_after( ticks );<br>  }<br>}<br><br></div>Notice I've defined that if the least significant bit of my variable task_count is 1, then I set both LED1 and LED2. If that LSB is zero, I just call to clear LED1. <br></div>When I actually run this, both LED1 and LED2 are being cleared! Same is true with the 3rd and 4th user LEDs as well, if I happen to set all four of them. So I think somehow rtems_gpio_bsp_clear() is clearing the entire bank, not just the single pin specified in the argument. Can somebody confirm this behavior?<br></div>I will dig around and see if I can figure out why it's happening and generate a patch if I find it.<br><br></div>Also, I was hoping to be able to toggle a GPIO output by checking its current state and using that to decide whether to set or clear, but I don't see anything in the API that would allow me to check the state of an output. Is this a known/intended limitation?<br><div><div><br></div><div>Cheers,<br><br></div><div>Steve<br></div><div><br><br><br></div></div></div>