-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtestEEPROM.sh
executable file
·57 lines (53 loc) · 1.47 KB
/
testEEPROM.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
macro_slots=8
macro_depth=8
wake_slots=8
echo "read out initially"
for m_slot in $(seq $macro_slots); do
for i_slot in $(seq 0 $macro_depth); do
./irctl -dstm32 -m${m_slot} -i${i_slot} -g /dev/hidraw0
done
done
for w_slot in $(seq $wake_slots); do
./irctl -dstm32 -w${w_slot} -g /dev/hidraw0
done
#exit 0
echo "write pattern to eeprom"
i=0
for m_slot in $(seq $macro_slots); do
for i_slot in $(seq 0 $macro_depth); do
./irctl -dstm32 -m${m_slot} -i${i_slot} -s$(printf '0x%02x%02x%02x%02x%02x%02x\n' $i $i $i $i $i $i) /dev/hidraw0
((i++))
done
done
for w_slot in $(seq $wake_slots); do
./irctl -dstm32 -w${w_slot} -s$(printf '0x%02x%02x%02x%02x%02x%02x\n' $i $i $i $i $i $i) /dev/hidraw0
((i++))
done
echo "read out pattern"
for m_slot in $(seq $macro_slots); do
for i_slot in $(seq 0 $macro_depth); do
./irctl -dstm32 -m${m_slot} -i${i_slot} -g /dev/hidraw0
done
done
for w_slot in $(seq $wake_slots); do
./irctl -dstm32 -w${w_slot} -g /dev/hidraw0
done
echo "reset eeprom"
for m_slot in $(seq $macro_slots); do
for i_slot in $(seq 0 $macro_depth); do
./irctl -dstm32 -m${m_slot} -i${i_slot} -r /dev/hidraw0
done
done
for w_slot in $(seq $wake_slots); do
./irctl -dstm32 -w${w_slot} -r /dev/hidraw0
done
echo "read out once more"
for m_slot in $(seq $macro_slots); do
for i_slot in $(seq 0 $macro_depth); do
./irctl -dstm32 -m${m_slot} -i${i_slot} -g /dev/hidraw0
done
done
for w_slot in $(seq $wake_slots); do
./irctl -dstm32 -w${w_slot} -g /dev/hidraw0
done