mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-11-14 12:26:06 +01:00
13 lines
401 B
Bash
13 lines
401 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||
|
|
||
|
grep "#define [A-Z0-9_]\+ '[a-zA-Z]'" ../arduino/AFsignals.h | while read line
|
||
|
do
|
||
|
name="$(echo "$line" | cut -d ' ' -f 2)"
|
||
|
letter="$(echo "$line" | cut -d ' ' -f 3 | cut -d "'" -f 2)"
|
||
|
hex="$(python -c "print(hex(ord('$letter'))[2:])")"
|
||
|
|
||
|
echo " constant $name : std_logic_vector(7 downto 0) := x\"$hex\"; -- '$letter'"
|
||
|
done
|