Implement hexagram_tacho_set_gear()

This commit is contained in:
XANTRONIX Development 2024-01-28 22:39:37 +00:00
parent 7ec372ee48
commit 9836905566
2 changed files with 26 additions and 0 deletions

View file

@ -29,6 +29,8 @@ int hexagram_tacho_init(hexagram_tacho *tacho,
double redline, double redline,
double rpm_max); double rpm_max);
void hexagram_tacho_set_gear(hexagram_tacho *tacho, hexagram_trans_gear gear);
int hexagram_tacho_shift_indicator_init(hexagram_tacho_shift_indicator *shift, int hexagram_tacho_shift_indicator_init(hexagram_tacho_shift_indicator *shift,
double x, double x,
double y, double y,

View file

@ -166,6 +166,30 @@ error_dial_init:
return -1; return -1;
} }
void hexagram_tacho_set_gear(hexagram_tacho *tacho, hexagram_trans_gear gear) {
switch (gear) {
case HEXAGRAM_TRANS_GEAR_S:
case HEXAGRAM_TRANS_GEAR_D:
case HEXAGRAM_TRANS_GEAR_P:
case HEXAGRAM_TRANS_GEAR_R:
case HEXAGRAM_TRANS_GEAR_N:
case HEXAGRAM_TRANS_GEAR_1:
case HEXAGRAM_TRANS_GEAR_2:
case HEXAGRAM_TRANS_GEAR_3:
case HEXAGRAM_TRANS_GEAR_4:
case HEXAGRAM_TRANS_GEAR_5:
case HEXAGRAM_TRANS_GEAR_6:
case HEXAGRAM_TRANS_GEAR_7:
case HEXAGRAM_TRANS_GEAR_8:
case HEXAGRAM_TRANS_GEAR_9:
case HEXAGRAM_TRANS_GEAR_10:
tacho->gear = gear;
default:
return;
}
}
#define LIGHT_LEVEL_COUNT 5 #define LIGHT_LEVEL_COUNT 5
#define LIGHT_WIDTH 48 #define LIGHT_WIDTH 48
#define LIGHT_HEIGHT 12 #define LIGHT_HEIGHT 12