summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/agptek/debug-agptek.c6
-rw-r--r--firmware/target/hosted/aigo/power-erosq.c26
-rw-r--r--firmware/target/hosted/alsa-controls.h2
3 files changed, 21 insertions, 13 deletions
diff --git a/firmware/target/hosted/agptek/debug-agptek.c b/firmware/target/hosted/agptek/debug-agptek.c
index a9b829f7ec..de4bc946bc 100644
--- a/firmware/target/hosted/agptek/debug-agptek.c
+++ b/firmware/target/hosted/agptek/debug-agptek.c
@@ -37,6 +37,8 @@
37 37
38static int line = 0; 38static int line = 0;
39 39
40extern int hwver;
41
40bool dbg_hw_info(void) 42bool dbg_hw_info(void)
41{ 43{
42 int btn = 0; 44 int btn = 0;
@@ -61,6 +63,10 @@ bool dbg_hw_info(void)
61 lcd_putsf(0, line++, "Boot ver: %s", verstr); 63 lcd_putsf(0, line++, "Boot ver: %s", verstr);
62 } 64 }
63 65
66#ifdef EROS_Q
67 lcd_putsf(0, line++, "hwver: %d", hwver);
68#endif
69
64 lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate()); 70 lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate());
65 lcd_putsf(0, line++, "pcm xruns: %d", pcm_alsa_get_xruns()); 71 lcd_putsf(0, line++, "pcm xruns: %d", pcm_alsa_get_xruns());
66#ifdef HAVE_HEADPHONE_DETECTION 72#ifdef HAVE_HEADPHONE_DETECTION
diff --git a/firmware/target/hosted/aigo/power-erosq.c b/firmware/target/hosted/aigo/power-erosq.c
index 664ee144af..7c4515f616 100644
--- a/firmware/target/hosted/aigo/power-erosq.c
+++ b/firmware/target/hosted/aigo/power-erosq.c
@@ -45,16 +45,16 @@ const char * const sysfs_bat_status[2] = {
45 "/sys/class/power_supply/axp_battery/status", 45 "/sys/class/power_supply/axp_battery/status",
46}; 46};
47 47
48static int hwver = 0; 48int hwver = 1; /* Exported */
49 49
50unsigned int erosq_power_get_battery_voltage(void) 50unsigned int erosq_power_get_battery_voltage(void)
51{ 51{
52 int battery_voltage; 52 int battery_voltage;
53 int x = sysfs_get_int(sysfs_bat_voltage[hwver], &battery_voltage); 53 int x = sysfs_get_int(sysfs_bat_voltage[hwver == 4], &battery_voltage);
54 54
55 if (!x) { 55 if (!x && hwver != 4) {
56 hwver ^= 1; 56 hwver = 4;
57 sysfs_get_int(sysfs_bat_voltage[hwver], &battery_voltage); 57 sysfs_get_int(sysfs_bat_voltage[hwver == 4], &battery_voltage);
58 } 58 }
59 59
60 return battery_voltage/1000; 60 return battery_voltage/1000;
@@ -63,11 +63,11 @@ unsigned int erosq_power_get_battery_voltage(void)
63unsigned int erosq_power_get_battery_capacity(void) 63unsigned int erosq_power_get_battery_capacity(void)
64{ 64{
65 int battery_capacity; 65 int battery_capacity;
66 int x = sysfs_get_int(sysfs_bat_capacity[hwver], &battery_capacity); 66 int x = sysfs_get_int(sysfs_bat_capacity[hwver == 4], &battery_capacity);
67 67
68 if (!x) { 68 if (!x && hwver != 4) {
69 hwver ^= 1; 69 hwver = 4;
70 sysfs_get_int(sysfs_bat_capacity[hwver], &battery_capacity); 70 sysfs_get_int(sysfs_bat_capacity[hwver == 4], &battery_capacity);
71 } 71 }
72 72
73 return battery_capacity; 73 return battery_capacity;
@@ -81,11 +81,11 @@ bool charging_state(void)
81{ 81{
82 if ((current_tick - last_tick) > HZ/2 ) { 82 if ((current_tick - last_tick) > HZ/2 ) {
83 char buf[12] = {0}; 83 char buf[12] = {0};
84 int x = sysfs_get_string(sysfs_bat_status[hwver], buf, sizeof(buf)); 84 int x = sysfs_get_string(sysfs_bat_status[hwver == 4], buf, sizeof(buf));
85 85
86 if (!x) { 86 if (!x && hwver != 4) {
87 hwver ^= 1; 87 hwver = 4;
88 sysfs_get_string(sysfs_bat_status[hwver], buf, sizeof(buf)); 88 sysfs_get_string(sysfs_bat_status[hwver == 4], buf, sizeof(buf));
89 } 89 }
90 90
91 last_tick = current_tick; 91 last_tick = current_tick;
diff --git a/firmware/target/hosted/alsa-controls.h b/firmware/target/hosted/alsa-controls.h
index af3e584cd9..b868ef52fb 100644
--- a/firmware/target/hosted/alsa-controls.h
+++ b/firmware/target/hosted/alsa-controls.h
@@ -36,6 +36,8 @@ void alsa_controls_close(void);
36 36
37/* check wether a control exists */ 37/* check wether a control exists */
38bool alsa_has_control(const char *name); 38bool alsa_has_control(const char *name);
39/* find a control element ID by name, return -1 of not found or index into array */
40int alsa_controls_find(const char *name);
39/* find a control element enum index by name, return -1 if not found */ 41/* find a control element enum index by name, return -1 if not found */
40int alsa_controls_find_enum(const char *name, const char *enum_name); 42int alsa_controls_find_enum(const char *name, const char *enum_name);
41/* set a control, potentially supports several values */ 43/* set a control, potentially supports several values */