summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ceca79d)
Instead of trying to compute these values as soon as the necessary
data are available, delay until all data are available as which data
are necessary depends on the target device, and some target devices
don't have some of the data values at all.
Signed-off-by: Keith Packard <keithp@keithp.com>
/* Return + accel calibration relative to a specific pad orientation */
public int accel_cal_plus(int pad_orientation) {
adjust_accel_cal();
/* Return + accel calibration relative to a specific pad orientation */
public int accel_cal_plus(int pad_orientation) {
adjust_accel_cal();
+ if (!accel_cal_adjusted)
+ return AltosLib.MISSING;
+
switch (pad_orientation) {
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
case AltosLib.AO_PAD_ORIENTATION_WORDS_UPRIGHT:
switch (pad_orientation) {
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
case AltosLib.AO_PAD_ORIENTATION_WORDS_UPRIGHT:
/* Return - accel calibration relative to a specific pad orientation */
public int accel_cal_minus(int pad_orientation) {
adjust_accel_cal();
/* Return - accel calibration relative to a specific pad orientation */
public int accel_cal_minus(int pad_orientation) {
adjust_accel_cal();
+ if (!accel_cal_adjusted)
+ return AltosLib.MISSING;
+
switch (pad_orientation) {
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
case AltosLib.AO_PAD_ORIENTATION_WORDS_UPRIGHT:
switch (pad_orientation) {
case AltosLib.AO_PAD_ORIENTATION_ANTENNA_UP:
case AltosLib.AO_PAD_ORIENTATION_WORDS_UPRIGHT:
*/
private void adjust_accel_cal() {
if (!accel_cal_adjusted &&
*/
private void adjust_accel_cal() {
if (!accel_cal_adjusted &&
pad_orientation != AltosLib.MISSING &&
accel_cal_plus != AltosLib.MISSING &&
accel_cal_minus != AltosLib.MISSING)
pad_orientation != AltosLib.MISSING &&
accel_cal_plus != AltosLib.MISSING &&
accel_cal_minus != AltosLib.MISSING)
}
}
} catch (Exception e) {}
}
}
} catch (Exception e) {}
-
- /* Fix accel cal as soon as all of the necessary values appear */
- adjust_accel_cal();
}
public AltosConfigData() {
}
public AltosConfigData() {
read_link(link, "done");
break;
}
read_link(link, "done");
break;
}