Coder Social home page Coder Social logo

96boards-uart's People

Contributors

daniel-thompson avatar glikely avatar srinivas-kandagatla avatar tioez326 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

96boards-uart's Issues

`96boardsctl reset` shows usage on Raspberry Pi

I've compiled 96boardsctrl on my ARM-based Raspberry Pi running Raspbian Jesse Lite but found that it just shows its usage when I ask it to reset:

root@pi:/home/pi/96boards-uart/96boardsctl# ./96boardsctl reset

Usage: ./96boardsctl [OPTION]... command
Control the power button and reset lines with a 96boards USB console adaptor

  -h, --help                    Display this help and exit
  -o, --old                     Using old v0.3 prototype board
  -l, --list                    List available devices and exit
  -L, --long                    Use long 5s pulse, useful to force board to power off
  -p, --pulse-width=TIME        Length of signal pulse in ms
  -s, --serial <serial> Specify device to open by serial number

Commands:
  power                 Pulse the power button signal
  reset                 Pulse the reset button signal

This program causes the kernel's ftdi_sio driver to disconnect from the UART device
It can be reconnected by echoing the device name into /sys/bus/usb/drivers/ftdi_sio/bind

I believe this is because getopt_long() returns -1 when it has finished parsing options, but this is being assigned to an (unsigned) char which is always greater than zero, so the while loop never exits, causing the switch statements default to be chosen.

The following patch solved this for me:

index a2bead7..d2e0a7d 100644
--- a/96boardsctl/96boardsctl.c
+++ b/96boardsctl/96boardsctl.c
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])

        ftdi_init(&ftdi);

-       while ((c = getopt_long(argc, argv, optstring, long_options, NULL)) >= 0) {
+       while ((c = getopt_long(argc, argv, optstring, long_options, NULL)) != (char) -1) {
                switch (c) {
                case 1:
                        if (count >= 3) {

Unknown components

What is:
SOT-23_Seeed
USB_MICRO_B_ST-USB-001E
Socket_Strip_SMD_2x20_Pitch2mm
SW_PUSH_DTSM_62K

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.