reform

MNT Reform: Open Source Portable Computer
Log (Feed) | Files | Refs (Tags) | README

commit 1345547998e349a37ef69598750b6f127cf3cd78
parent 02a04a2c79230471b71d7bd5f8171c8b8302927d
Author: mntmn <lukas@mntre.com>
Date:   Fri, 22 May 2020 13:57:28 +0200

Merge branch 'reform2-nitrogen8m'

Diffstat:
Mreform2-keyboard-fw/Keyboard.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/reform2-keyboard-fw/Keyboard.c b/reform2-keyboard-fw/Keyboard.c @@ -122,7 +122,7 @@ int remote_receive_string(int print) { while (chr==-1 || chr==0) { chr=Serial_ReceiveByte(); clock++; - if (clock>100000) goto timeout; + if (clock>500000) goto timeout; } int poke_chr = chr; if (chr=='\n') poke_chr=' '; @@ -229,7 +229,7 @@ void remote_get_voltages(void) { Serial_SendByte('\r'); Delay_MS(1); remote_receive_string(0); - bat_amps = -((float)atoi(response))/1000.0; + bat_amps = ((float)atoi(response))/1000.0; float sum_volts = 0; @@ -256,17 +256,17 @@ void remote_get_voltages(void) { if (percentage<0) percentage = 0; char str[32]; - sprintf(str,"[] %.1f [] %.1f",voltages[0],voltages[4]); + sprintf(str,"[] %.1f [] %.1f %d%%",voltages[0],voltages[4],(int)percentage); insert_bat_icon(str,0,voltages[0]); insert_bat_icon(str,8,voltages[4]); gfx_poke_str(0,0,str); - sprintf(str,"[] %.1f [] %.1f %d%%",voltages[1],voltages[5],(int)percentage); + sprintf(str,"[] %.1f [] %.1f ",voltages[1],voltages[5]); insert_bat_icon(str,0,voltages[1]); insert_bat_icon(str,8,voltages[5]); gfx_poke_str(0,1,str); - sprintf(str,"[] %.1f [] %.1f %.2fA",voltages[2],voltages[6],bat_amps); + sprintf(str,"[] %.1f [] %.1f %.2fA",voltages[2],voltages[6],-bat_amps); insert_bat_icon(str,0,voltages[2]); insert_bat_icon(str,8,voltages[6]); gfx_poke_str(0,2,str);