mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
GET HW Info fixes
This commit is contained in:
parent
49faf25c80
commit
2b80a79c71
2 changed files with 23 additions and 9 deletions
|
@ -40,9 +40,16 @@ void menuRadioModulesVersion(event_t event)
|
||||||
|
|
||||||
if (event == EVT_ENTRY) {
|
if (event == EVT_ENTRY) {
|
||||||
menuVerticalOffset = 0;
|
menuVerticalOffset = 0;
|
||||||
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_GET_HARDWARE_INFO;
|
|
||||||
memclear(&reusableBuffer.hardware.modules, sizeof(reusableBuffer.hardware.modules));
|
memclear(&reusableBuffer.hardware.modules, sizeof(reusableBuffer.hardware.modules));
|
||||||
|
|
||||||
|
#warning "Only do this if internal module is ON"
|
||||||
|
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_GET_HARDWARE_INFO;
|
||||||
reusableBuffer.hardware.modules[INTERNAL_MODULE].step = -1;
|
reusableBuffer.hardware.modules[INTERNAL_MODULE].step = -1;
|
||||||
|
|
||||||
|
#warning "Only do this if external module is ON"
|
||||||
|
moduleSettings[EXTERNAL_MODULE].mode = MODULE_MODE_GET_HARDWARE_INFO;
|
||||||
|
reusableBuffer.hardware.modules[EXTERNAL_MODULE].step = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t y = (FH + 1) - menuVerticalOffset * FH;
|
coord_t y = (FH + 1) - menuVerticalOffset * FH;
|
||||||
|
@ -87,16 +94,23 @@ void menuRadioModulesVersion(event_t event)
|
||||||
if (lines > NUM_BODY_LINES) {
|
if (lines > NUM_BODY_LINES) {
|
||||||
drawVerticalScrollbar(LCD_W-1, FH, LCD_H-FH, menuVerticalOffset, lines, NUM_BODY_LINES);
|
drawVerticalScrollbar(LCD_W-1, FH, LCD_H-FH, menuVerticalOffset, lines, NUM_BODY_LINES);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
menuVerticalOffset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case EVT_KEY_PREVIOUS_LINE:
|
case EVT_KEY_PREVIOUS_LINE:
|
||||||
if (menuVerticalOffset-- == 0)
|
if (lines > NUM_BODY_LINES) {
|
||||||
menuVerticalOffset = lines - 1;
|
if (menuVerticalOffset-- == 0)
|
||||||
|
menuVerticalOffset = lines - 1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_NEXT_LINE:
|
case EVT_KEY_NEXT_LINE:
|
||||||
if (++menuVerticalOffset + NUM_BODY_LINES > lines)
|
if (lines > NUM_BODY_LINES) {
|
||||||
menuVerticalOffset = 0;
|
if (++menuVerticalOffset + NUM_BODY_LINES > lines)
|
||||||
|
menuVerticalOffset = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_EXIT):
|
case EVT_KEY_BREAK(KEY_EXIT):
|
||||||
|
|
|
@ -79,12 +79,12 @@ void processGetHardwareInfoFrame(uint8_t module, uint8_t * frame)
|
||||||
|
|
||||||
uint8_t index = frame[3];
|
uint8_t index = frame[3];
|
||||||
if (index == 0xFF) {
|
if (index == 0xFF) {
|
||||||
reusableBuffer.hardware.modules[module].hw_version = *((uint32_t *)&frame[4]);
|
reusableBuffer.hardware.modules[module].hw_version = *((uint16_t *)&frame[4]);
|
||||||
reusableBuffer.hardware.modules[module].sw_version = *((uint32_t *)&frame[8]);
|
reusableBuffer.hardware.modules[module].sw_version = *((uint16_t *)&frame[6]);
|
||||||
}
|
}
|
||||||
else if (index < PXX2_MAX_RECEIVERS_PER_MODULE){
|
else if (index < PXX2_MAX_RECEIVERS_PER_MODULE){
|
||||||
reusableBuffer.hardware.modules[module].receivers[index].hw_version = *((uint32_t *)&frame[4]);
|
reusableBuffer.hardware.modules[module].receivers[index].hw_version = *((uint16_t *)&frame[4]);
|
||||||
reusableBuffer.hardware.modules[module].receivers[index].sw_version = *((uint32_t *)&frame[8]);
|
reusableBuffer.hardware.modules[module].receivers[index].sw_version = *((uint16_t *)&frame[6]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue