A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/stlink-org/stlink/pull/1211 below:

Can we remove some unused code? · Issue #1211 · stlink-org/stlink · GitHub

In usb.c there are next lines:

stlink_t *stlink_open_usb(...) {
line 1144:
    // TODO: Reading a environment variable in a usb open function is not very nice, this should
    // be refactored and moved into the CLI tools, and instead of giving USB_BUS:USB_ADDR a real
    // stlink serial string should be passed to this function. Probably people are using this
    // but this is very odd because as programmer can change to multiple busses and it is better
    // to detect them based on serial.
    char *device = getenv("STLINK_DEVICE");

Here supposed that there is an environment variable in user system with name "STLINK_DEVICE" and value "Device_bus:Device_Address". In case of presence such variable in user system function gets device bus and device address from USB devices list and compare them with ones in environment variable. If do not match then proceed with next USB device from list.

There is no such variable in my system. I can not find any place in code which set this variable. Function stlink_open_usb gets serial of ST-LINK in 3rd parameter and uses it to find right USB device. So may it be useful to completely remove all code which works with getenv function and variables device, devBus and devAddr?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4