projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ao-tools: Use array indexing instead of addition to make gcc-10 happy
[fw/altos]
/
altoslib
/
AltosTelemetryCompanion.java
diff --git
a/altoslib/AltosTelemetryCompanion.java
b/altoslib/AltosTelemetryCompanion.java
index c47f9486ff1f8dc803b0ad15e26fb704fdf37a67..c5faef3e2709f4a541c3eff801dc9a02dbd11db5 100644
(file)
--- a/
altoslib/AltosTelemetryCompanion.java
+++ b/
altoslib/AltosTelemetryCompanion.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,24
+16,19
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_
9
;
+package org.altusmetrum.altoslib_
14
;
public class AltosTelemetryCompanion extends AltosTelemetryStandard {
public class AltosTelemetryCompanion extends AltosTelemetryStandard {
- AltosCompanion companion;
-
- static final public int max_channels = 12;
-
- public AltosTelemetryCompanion(int[] bytes) {
- super(bytes);
+ AltosCompanion companion() {
int channels = uint8(7);
if (channels > max_channels)
channels = max_channels;
int channels = uint8(7);
if (channels > max_channels)
channels = max_channels;
- companion = new AltosCompanion(channels);
+
AltosCompanion
companion = new AltosCompanion(channels);
- companion.tick = tick;
+ companion.tick = tick
()
;
companion.board_id = uint8(5);
companion.update_period = uint8(6);
companion.board_id = uint8(5);
companion.update_period = uint8(6);
@@
-44,11
+40,17
@@
public class AltosTelemetryCompanion extends AltosTelemetryStandard {
for (int i = 0; i < channels; i++)
companion.companion_data[i] = uint16(8 + i * 2);
}
for (int i = 0; i < channels; i++)
companion.companion_data[i] = uint16(8 + i * 2);
}
+ return companion;
}
}
- public void update_state(AltosState state) {
- super.update_state(state);
+ static final public int max_channels = 12;
+
+ public AltosTelemetryCompanion(int[] bytes) throws AltosCRCException {
+ super(bytes);
+ }
- state.set_companion(companion);
+ public void provide_data(AltosDataListener listener) {
+ super.provide_data(listener);
+ listener.set_companion(companion());
}
}
}
}