mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-11 06:09:08 -07:00
One of too many. Cloning the Apps from gh for easy-updates
This commit is contained in:
@@ -362,8 +362,7 @@ static void _draw_carousel_info(Canvas* canvas) {
|
||||
BUFF_SIZE,
|
||||
"0x%02X",
|
||||
((I2CSensor*)unitemp_sensor_getActive(generalview_sensor_index)->instance)
|
||||
->currentI2CAdr >>
|
||||
1);
|
||||
->currentI2CAdr);
|
||||
canvas_draw_str(canvas, 57, 35, app->buff);
|
||||
canvas_draw_str(canvas, 54, 46, "15 (C0)");
|
||||
canvas_draw_str(canvas, 54, 58, "16 (C1)");
|
||||
|
||||
@@ -214,9 +214,9 @@ static void _gpio_change_callback(VariableItem* item) {
|
||||
static void _i2caddr_change_callback(VariableItem* item) {
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
((I2CSensor*)editable_sensor->instance)->currentI2CAdr =
|
||||
((I2CSensor*)editable_sensor->instance)->minI2CAdr + index * 2;
|
||||
((I2CSensor*)editable_sensor->instance)->minI2CAdr + index;
|
||||
char buff[5];
|
||||
snprintf(buff, 5, "0x%2X", ((I2CSensor*)editable_sensor->instance)->currentI2CAdr >> 1);
|
||||
snprintf(buff, 5, "0x%2X", ((I2CSensor*)editable_sensor->instance)->currentI2CAdr);
|
||||
variable_item_set_current_value_text(item, buff);
|
||||
}
|
||||
/**
|
||||
@@ -335,15 +335,11 @@ void unitemp_SensorEdit_switch(Sensor* sensor) {
|
||||
VariableItem* item = variable_item_list_add(
|
||||
variable_item_list,
|
||||
"I2C address",
|
||||
(((I2CSensor*)sensor->instance)->maxI2CAdr >> 1) -
|
||||
(((I2CSensor*)sensor->instance)->minI2CAdr >> 1) + 1,
|
||||
((I2CSensor*)sensor->instance)->maxI2CAdr - ((I2CSensor*)sensor->instance)->minI2CAdr +
|
||||
1,
|
||||
_i2caddr_change_callback,
|
||||
app);
|
||||
snprintf(app->buff, 5, "0x%2X", ((I2CSensor*)sensor->instance)->currentI2CAdr >> 1);
|
||||
variable_item_set_current_value_index(
|
||||
item,
|
||||
(((I2CSensor*)sensor->instance)->currentI2CAdr >> 1) -
|
||||
(((I2CSensor*)sensor->instance)->minI2CAdr >> 1));
|
||||
snprintf(app->buff, 5, "0x%2X", ((I2CSensor*)sensor->instance)->currentI2CAdr);
|
||||
variable_item_set_current_value_text(item, app->buff);
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ void unitemp_widget_delete_switch(Sensor* sensor) {
|
||||
app->buff,
|
||||
BUFF_SIZE,
|
||||
"\e#I2C addr:\e# 0x%02X",
|
||||
((I2CSensor*)current_sensor->instance)->currentI2CAdr >> 1);
|
||||
((I2CSensor*)current_sensor->instance)->currentI2CAdr);
|
||||
widget_add_text_box_element(
|
||||
app->widget, 0, 28, 128, 23, AlignLeft, AlignTop, app->buff, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user