mirror of
https://github.com/specht/champ.git
synced 2025-01-02 13:30:40 +00:00
yay
This commit is contained in:
parent
e7ec175771
commit
0688777f00
21
parse_watches.rb
Executable file
21
parse_watches.rb
Executable 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
|
20
watches.h
20
watches.h
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user