1
0
mirror of https://github.com/specht/champ.git synced 2024-06-09 04:29:29 +00:00
This commit is contained in:
Michael Specht 2018-02-11 22:35:43 +01:00
parent e7ec175771
commit 0688777f00
2 changed files with 40 additions and 1 deletions

21
parse_watches.rb Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env ruby
vars = {}
File::open(ARGV.first) do |f|
f.each_line do |line|
parts = line.split(' ')
name = parts[1]
value = parts[2].to_i
vars[name] ||= []
vars[name] << value
end
end
vars.keys.sort.each do |name|
vars[name].sort!
format_str = "%-#{vars.keys.map { |x| x.size }.max}s assigned %8d times, min. %6d, max. %6d, median %6d"
puts sprintf(format_str,
name, vars[name].size, vars[name].first, vars[name].last,
vars[name][vars[name].size / 2])
end

View File

@ -1,19 +1,37 @@
const uint16_t WATCH_COUNT = 3;
const uint16_t WATCH_COUNT = 9;
#define WATCH_U8 1
#define WATCH_U16 2
#define WATCH_S8 3
#define WATCH_S16 4
const char* WATCH_LABELS[] = {
"SINX",
"COSX",
"SINY",
"COSY",
"SINZ",
"COSZ",
"RX",
"RY",
"RZ"
};
const uint16_t WATCH_ADDRESSES[] = {
0x007b,
0x007c,
0x007d,
0x007e,
0x007f,
0x0080,
0x008d,
0x008f,
0x0091
};
const uint8_t WATCH_TYPES[] = {
3,
3,
3,
3,
3,
3,
4,
4,
4