From de416941068db51412566821c08ee6b11637d06c Mon Sep 17 00:00:00 2001 From: Bluebie Date: Tue, 17 Dec 2013 11:58:55 +1100 Subject: commandline: style stuff, no functional changes --- commandline/library/littleWire_util.c | 19 +++++++++---------- commandline/library/littleWire_util.h | 5 +++-- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'commandline') diff --git a/commandline/library/littleWire_util.c b/commandline/library/littleWire_util.c index 985c4a3..c34460c 100644 --- a/commandline/library/littleWire_util.c +++ b/commandline/library/littleWire_util.c @@ -1,14 +1,13 @@ #include /* Delay in miliseconds */ -void delay(unsigned int duration) -{ - #if defined _WIN32 || defined _WIN64 - // use windows sleep api with milliseconds - // * 2 to make it run at half speed, because windows seems to have some trouble with this... - Sleep(duration * 2); - #else - // use standard unix api with microseconds - usleep(duration*1000); - #endif +void delay(unsigned int duration) { + #if defined _WIN32 || defined _WIN64 + // use windows sleep api with milliseconds + // * 2 to make it run at half speed, because windows seems to have some trouble with this... + Sleep(duration * 2); + #else + // use standard unix api with microseconds + usleep(duration*1000); + #endif } diff --git a/commandline/library/littleWire_util.h b/commandline/library/littleWire_util.h index 27dc172..1f060c3 100644 --- a/commandline/library/littleWire_util.h +++ b/commandline/library/littleWire_util.h @@ -2,12 +2,13 @@ #define LITTLEWIRE_UTIL_H #if defined WIN - #include + #include #else - #include + #include #endif /* Delay in miliseconds */ void delay(unsigned int duration); +// end LITTLEWIRE_UTIL_H section: #endif -- cgit v1.2.3 From 75d9e14fe513d1f04f605bc1159cb9a316e89209 Mon Sep 17 00:00:00 2001 From: Bluebie Date: Tue, 17 Dec 2013 19:49:22 +1100 Subject: commandline: no functional changes - improved readme info on configuring linux to not require root access, and included udev rules file - thanks @sodabrew! --- commandline/49-micronucleus.rules | 16 ++++++++++++++++ commandline/Readme | 7 ++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 commandline/49-micronucleus.rules (limited to 'commandline') diff --git a/commandline/49-micronucleus.rules b/commandline/49-micronucleus.rules new file mode 100644 index 0000000..bed33d6 --- /dev/null +++ b/commandline/49-micronucleus.rules @@ -0,0 +1,16 @@ +# UDEV Rules for Micronucleus boards including the Digispark. +# This file must be placed at: +# +# /etc/udev/rules.d/49-micronucleus.rules (preferred location) +# or +# /lib/udev/rules.d/49-micronucleus.rules (req'd on some broken systems) +# +# After this file is copied, physically unplug and reconnect the board. +# +SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666" +KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1" +# +# If you share your linux system with other users, or just don't like the +# idea of write permission for everybody, you can replace MODE:="0666" with +# OWNER:="yourusername" to create the device owned by you, or with +# GROUP:="somegroupname" and mange access using standard unix groups. diff --git a/commandline/Readme b/commandline/Readme index 00e91f7..1781e36 100644 --- a/commandline/Readme +++ b/commandline/Readme @@ -12,9 +12,10 @@ Usage on Mac: Usage on Windows micronucleus.exe --run name_of_the_file.hex -Raw binary file writing hasn't been tested much yet and is suspected to not -work. +Raw binary file writing hasn't been tested as much as hex files. Every now and then the program fails once it reaches the Writing stage - this is a known bug - but if you simply rerun the micronucleus command immediately, it -will succeed the second time usually. Most of the time this issue is not present. \ No newline at end of file +will succeed the second time usually. Most of the time this issue is not present. + +To linux users: sudo is used above because the default configuration under most modern linux distributions is to not allow userspace apps to communicate directly to unknown USB devices. You can fix this by installing some config files, or you can just use sudo. Either way you're going to need root. To configure your system to allow micronucleus access from non-root users, copy 49-micronucleus.rules from this folder to /etc/udev/rules.d/ -- cgit v1.2.3 From bfad6fd1716773c2872ca2b161775b3a2dbc24e6 Mon Sep 17 00:00:00 2001 From: Bluebie Date: Tue, 17 Dec 2013 19:50:17 +1100 Subject: commandline: no functional changes - getting rid of tab chars --- commandline/Readme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commandline') diff --git a/commandline/Readme b/commandline/Readme index 1781e36..8f3d5f3 100644 --- a/commandline/Readme +++ b/commandline/Readme @@ -6,7 +6,7 @@ three. To make and install, do the regular 'make; sudo make install' on unixes. On windows just 'make' with mingw and do whatever people do with windows exes. Usage on Ubuntu: - sudo micronucleus --run name_of_the_file.hex + sudo micronucleus --run name_of_the_file.hex Usage on Mac: micronucleus --run name_of_the_file.hex Usage on Windows -- cgit v1.2.3 From 04e0d950d18fba8af17e844f9d6d0bb868cb5981 Mon Sep 17 00:00:00 2001 From: Bluebie Date: Tue, 17 Dec 2013 19:51:50 +1100 Subject: commandline: readme.. My brain is bad today. no functional changes, just style stuff --- commandline/Readme | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'commandline') diff --git a/commandline/Readme b/commandline/Readme index 8f3d5f3..329247a 100644 --- a/commandline/Readme +++ b/commandline/Readme @@ -18,4 +18,9 @@ Every now and then the program fails once it reaches the Writing stage - this is a known bug - but if you simply rerun the micronucleus command immediately, it will succeed the second time usually. Most of the time this issue is not present. -To linux users: sudo is used above because the default configuration under most modern linux distributions is to not allow userspace apps to communicate directly to unknown USB devices. You can fix this by installing some config files, or you can just use sudo. Either way you're going to need root. To configure your system to allow micronucleus access from non-root users, copy 49-micronucleus.rules from this folder to /etc/udev/rules.d/ +To linux users: sudo is used above because the default configuration under most +modern linux distributions is to not allow userspace apps to communicate +directly to unknown USB devices. You can fix this by installing some config +files, or you can just use sudo. Either way you're going to need root. To +configure your system to allow micronucleus access from non-root users, copy +49-micronucleus.rules from this folder to /etc/udev/rules.d/ -- cgit v1.2.3