aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-09-18 16:18:49 -0600
committerSelene ToyKeeper2019-09-18 16:18:49 -0600
commita0b974352bccb97a9efdd66fffe6825793b5e5d0 (patch)
treeb001326e595be48dcafd90dbf4ab01318d7b4010
parentmerged MF01-Mini / MT07 support branch (diff)
parentadded a compile flag to fix compatibility with GCC 7/8/9's new semantics for ... (diff)
downloadanduril-a0b974352bccb97a9efdd66fffe6825793b5e5d0.tar.gz
anduril-a0b974352bccb97a9efdd66fffe6825793b5e5d0.tar.bz2
anduril-a0b974352bccb97a9efdd66fffe6825793b5e5d0.zip
merged updates from trunk, including gcc7/8/9 compatibility
Diffstat (limited to '')
-rw-r--r--README7
-rwxr-xr-xbin/build.sh4
-rwxr-xr-xbin/level_calc.py14
3 files changed, 20 insertions, 5 deletions
diff --git a/README b/README
index 3cb27e9..1e6e842 100644
--- a/README
+++ b/README
@@ -28,6 +28,7 @@ Some useful hardware for flashing firmware:
http://www.fasttech.com/product/1002900-atmega-attiny-51-avr-isp-usbasp-usb-programmer
http://www.fasttech.com/product/1011800-40-pin-splittable-ribbon-cable-20cm
http://www.digikey.com/product-detail/en/5250/501-1311-ND/745102
+ HQ ProgKey: http://budgetlightforum.com/node/63230
Ratus' guide: https://redd.it/8g5l5w (prices checked 2018-05-01)
@@ -69,6 +70,12 @@ To set up an attiny dev environment on Ubuntu (13.10):
Optional: (make avrdude usable by non-root users, is a security risk)
sudo chmod u+s $(which avrdude)
+To set up an attiny dev environment on Fedora (30):
+
+ sudo dnf install flex byacc bison gcc libusb libusb-devel glibc-devel
+ sudo dnf install avr-gcc avr-libc avr-binutils
+ sudo dnf install avrdude
+
Building/installing attiny dev tools on other UNIX systems (in general):
http://www.ladyada.net/learn/avr/setup-unix.html
diff --git a/bin/build.sh b/bin/build.sh
index 192fa30..fbb24ea 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -14,9 +14,9 @@ export PROGRAM=$1 ; shift
export MCU=attiny$ATTINY
export CC=avr-gcc
export OBJCOPY=avr-objcopy
-export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -DATTINY=$ATTINY -I.. -I../.. -I../../.. -fshort-enums"
+export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -fgnu89-inline -DATTINY=$ATTINY -I.. -I../.. -I../../.. -fshort-enums"
export OFLAGS="-Wall -g -Os -mmcu=$MCU"
-export LDFLAGS=
+export LDFLAGS="-fgnu89-inline"
export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex'
export OBJS=$PROGRAM.o
diff --git a/bin/level_calc.py b/bin/level_calc.py
index f1e7d16..74385da 100755
--- a/bin/level_calc.py
+++ b/bin/level_calc.py
@@ -14,7 +14,7 @@ def main(args):
"""
# Get parameters from the user
questions_main = [
- (str, 'ramp_shape', 'cube', 'Ramp shape? [cube, square, fifth, seventh, ninth, log]'),
+ (str, 'ramp_shape', 'cube', 'Ramp shape? [cube, square, fifth, seventh, ninth, log, N.NN]'),
(int, 'num_channels', 1, 'How many power channels?'),
(int, 'num_levels', 4, 'How many total levels do you want?'),
]
@@ -189,11 +189,19 @@ shapes = dict(
)
def power(x):
- return shapes[ramp_shape][0](x)
+ try:
+ factor = float(ramp_shape)
+ return math.pow(x, factor)
+ except ValueError:
+ return shapes[ramp_shape][0](x)
def invpower(x):
- return shapes[ramp_shape][1](x)
+ try:
+ factor = float(ramp_shape)
+ return math.pow(x, 1.0 / factor)
+ except ValueError:
+ return shapes[ramp_shape][1](x)
def input_text():