From 294a1ad94f681b822ccaddc63173318b8d75fbc4 Mon Sep 17 00:00:00 2001 From: karawin Date: Tue, 19 Feb 2019 19:24:19 +0100 Subject: [PATCH] prerelease 1.9R1 CSV: key,type,encoding,value label_space,namespace,, L_LABEL,data,string,"standard_touch.csv. " L_COMMENT,data,string,This is the standard configuration with the touch screen added. gpio_space,namespace,, .... __________________________ sys.conf ##CONFIG# #LABEL: standard_touch.csv. #COMMENT: This is the standard configuration with the touch screen added. And new: Double click for time/main as before , but choice is now permanent. Bugs removed. More reactive display. --- boards/build/lolin32pro.bin | Bin 8192 -> 8192 bytes boards/build/new_psram.bin | Bin 8192 -> 8192 bytes boards/build/odroid-go.bin | Bin 8192 -> 8192 bytes boards/build/pattern.bin | Bin 8192 -> 8192 bytes boards/build/standard_adb.bin | Bin 8192 -> 8192 bytes boards/build/standard_psram.bin | Bin 8192 -> 8192 bytes boards/build/standard_touch.bin | Bin 8192 -> 8192 bytes boards/build/test.bin | Bin 8192 -> 0 bytes boards/build/ttgot8.bin | Bin 8192 -> 8192 bytes boards/build/ttgotm.bin | Bin 8192 -> 8192 bytes boards/lolin32pro.csv | 5 + boards/new_psram.csv | 7 +- boards/odroid-go.csv | 5 + boards/pattern.csv | 16 +++ boards/standard_adb.csv | 11 +- boards/standard_psram.csv | 5 + boards/standard_touch.csv | 5 + boards/test.csv | 61 ---------- boards/ttgot8.csv | 5 + boards/ttgotm.csv | 5 + boards/ttgov4.csv | 5 + main/ClickButtons.c | 12 +- main/ClickEncoder.c | 68 ++++++++--- main/ClickJoystick.c | 27 ++--- main/addon.c | 197 +++++++++++++++++--------------- main/app_main.c | 16 +-- main/gpio.c | 39 +++++++ main/include/ClickButtons.h | 2 +- main/include/ClickEncoder.h | 12 +- main/include/ClickJoystick.h | 2 +- main/include/addon.h | 2 +- main/include/eeprom.h | 3 + main/include/gpio.h | 2 + main/include/interface.h | 2 +- main/interface.c | 23 ++++ 35 files changed, 328 insertions(+), 209 deletions(-) delete mode 100644 boards/build/test.bin delete mode 100644 boards/test.csv diff --git a/boards/build/lolin32pro.bin b/boards/build/lolin32pro.bin index c416282c5773e065f2b75c9fcee01877561f3436..5695258000f280caed6c10801d8843af638546df 100644 GIT binary patch literal 8192 zcmeHJYitxn9KY*BAcA0<+EfDBmPS*w^*`2wY-obwI<7}GS zOMn00V}83cxg}lKZSY!x_sna5z+`GxTlK@jAk|Da|5Ok9h{y4*|Q@>P@!x#I!E1LrZe4oT1M_d9FX!)5-NG zwZ8Tw*Out5GQCj#%`?9>?n=ZoD!wfT=g5J0@s)K>38+dSl|H>bgg4E--K&65K$X)2 zt114*sY~BOTvjQ8H57isb0kLrLQqQ6ZFf-ktA!&K3fL;B6pmpX`G5V?x9tjusH7V- zM*BD3?hHe|NDGuw`U}rroKk=o@jaF{D5LPMzY0H5fG;dK08b_gD7`3?`OCK(xHGMfVPk#wS5Ezk@tf-ZzPN2A!HGW2KeI4;SpnW?n95J% z1M|b<7*FZb{X9}!@C?QUvc64J{)0OQ>J9uB`By%?@HEC#`n11v&HD$&Q~ESMym34+IpZ#=SkphB(2-0r|t>1k1g&QW$ zJIMNJ{o480{3f2(FQWV_`j3myKLXT1Lzp*LK>J@&e^yaG6$B#!-UKBSf3SP|c@y`h zHp$%-{^q`851F{gM{xn`DSUDuIt2UW1t}P4Xf$^T?LQQnErlI5MTcHv#1P2F%$y+Am3mZ5I)K`RkinGTW@!d_AH1c zaYVBJ^5FSAwr8e80!<2DnsFdh}5jXQSx{SJqxmcw5h=CMiSb;K_{r+g>D{`@2y zR9FS)CQ7D1H))RA4B9fjdO4hwfJ`5MHst^0inT-7wubn-GlY=;^t-2F{z&TCq6HxT z)pxov-&vhOTjt*%|Hm!?QGNoSO^A>DN3S1Muzxl2_hbkm|95umpOHXnYaqJeKj+;z zX7Zgi8MI~o?+ttIm4MUWkq?w#djIee?oY7dM^628P694MHSUPdYj3%+f1MTo$l?5# zCE(8D-*Ym5+~imLtoR)xTh~aylg01L2QHl7(tq8mUoJ?XI*Y$|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#8B)h9pRX(i}v2Gtkr{P=}{e|CfF&Cv%R5-74|-U!nF{<$}v z6PW60?Jq&}$%d6p1d4Ok7YtP|5h%%7Z(c1vL||IZ`u)ja+Xzh0S)Y8kV+n!Mob?5l zFA)MWa@IG#_^iqcmg~Do&ZmPC-9#n@C)&A8iD`- diff --git a/boards/build/standard_psram.bin b/boards/build/standard_psram.bin index b01667dd349eec0d415f831f3e588cdb2ea11833..1a20cb240d51d10d8512c31c6f82247c55fe3787 100644 GIT binary patch literal 8192 zcmeH}ZD>_Gre+mCMzf9fo!Hf zm91YK9rupwf9BF`cu!wC!<8>p&>AW*zdJi}0fC`Moa&`T{OawND>}p?hF08A&FSyo zKDrHa&ENvmaQxWAZ`SFcL{U*LRdHM%`0SnzI~9ZDGRH5zFqP6FVK8sVwv`+YKj@2N zy~+ou<@n62Hz##a6T$7p1Zz3|(bdyo9fEPC0sL&oYK~8Sb#a>V0OL<`yfItzCF5q? z-m#41M?&j%7r3t&pJI#n|H-Cx8!0at|K;ER=w`fB{2yk9f7Kyi#<}|W`1*zAu3i;OCym&|W`+asKf&GmtDim)BukWz>M{MqIVEyy?mrdVluzBhD zbpz*BoIe3Zq%H2ZJK+8M&G^|M^%)RNDD)**!__~O+kM^U0p}%og5&7pv6D7e{U$Zw zF^(S?dgN&xOs!oBJ00@*yN^|!(BXNl1Dy7pF+u!&y}nhmxsSEKh(8|dn#KJGRcO;A zbOw02{1Yw1@9N-J6+i)%M&R?0A2N^N^Y<$#8fgpLZ!zO!K6#gab1TzFW?6AURniTW zm|q_b{O?%t{tg7~I&Ho1@K6UGBU!*DPol4S zrST}j{)Sj_ID#Af7cFnxL!j~FRjR;=SAKg=Zupl1NPcv>W(q;VIUCY|oBZDCGnEKb zZ3mrwZuNstP2E7;-E^yOJurj&FWz0Zdg;gE%Lq0QnX}yVKXG>K8iGbgOa5@9AAF~0 z9Kpu2^{sQkQ3TJHt(VlTA0pUPwthl>^e}?w%GM7yy|)uVQ`!2~U7u?RHkYlxQ9U2S z-+xShq8P%>`TaC>{3O2rk)T0`6At4>pZs)s3xY^I#C^Z|ulgn9MEolp5Do|jgag6> i;ec>JI3OGl4hRQ?1Hu8}fN(%KARG`52nYT*4*U(IsjdnD literal 8192 zcmeH}U1$_n6vuZGt01YZi5hE5iBhmCVv7qsu5!X9AcVP)hVSiYp^(5f z36v*O;#C5st~e<3nTPoEk)gXf)GDUtZzw|ikCEs~$~6-OC`P=e*jk{2q!M2qDnxuz zeAk!`Ya|o#62u4B6*lQ$m=@v%h{p<2D%Hz4z-+{??OJh72ib_!`2pr2-gU2~Mu$jL zDh1Kq@e$&WexEtWc-ZBiB0gny_QgC*JpxiNbDu} z1l51GwY%TpVeciGh4_{uo6k917AMxBY+dZ)&a#)BYneROD0ujb7S$==GZoWLb>OcNBPY?j|Q~N`B`iAh?Bt8+dO%*bD6^p&GpCQ z6NL28!_$JpwR(4k*hAIcW9yBOP_Kb3*VaOnDpqF_xO%(3{<(=%!;Y5L*j8xX&PvQ@ z8}eu8r6-S_Gzrw}to6)8U=Dglx&g;MZM}GS`Ef%1t#XT_5rXJn_3nF0K*QrTlt&X6 z^d(A4-%@~`f9CqndkGlc+1L#P$-nyJ#3TZ;wwlepp!($K^&x`pW>9_652Lhy|Lz9W zn_rx`O`zPCc`Hc&$G*M#CxNd#t^Fm4KH1ioAW)IBzG#+uk-*}d_2#9D9|_4sZv!1Ka`b0C#{p Kz#Vu`9C!oPrWo)5 diff --git a/boards/build/standard_touch.bin b/boards/build/standard_touch.bin index 57e5ae415d9e8913207b88dacb08f1e14c8a577e..61a9d1c98d037449f2f766ede3b1d2dfb8e3b055 100644 GIT binary patch literal 8192 zcmeH}Z)h839LJL;n~KhjmYV6HUS$j?EVS#~Ry$cPch@F9m)tFvx)p`rvLs!jYg3Z6 z1zBeYV}kf+{y`=ybiSCf!eIZHsMNK-sBbEcDd>D7r5SXrD(D=7*z>vEb9c{N1TSxW z9zrhU^L)S0@A=+yKW;WharqWr% z&f_I!-sU>}{I1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utfNC`J*%p*PxMX6QptBQ{AK5u`mq7k(1?5XW9{z?v9i#axNdMy> zpZSSEz0YM2LHL7j_ns&4T+#fdWsEc%f+ic-13A1YRtfKiF`fg+N2m z{KzZE4Fao+=1*7tlc4W6ww%gK1lhl=RdAld^k~=ApExXudg8xPd1_Vrw8TF x8YkkXa6mX991so&2ZRH{0pWmfKsX>A5Do|jgag6>;ec>JI3OGl4m_X({{ojA(X0Rf literal 8192 zcmeH}Ye*DP7>0K=EBaB^MmI{Z+Y%9#S(z0$JG0t!)}3i)rGn@qt!$xE%A%_XiJ(M5 zcBeA?VNg&YL>P1U==Z>RIH8H@8c-M!}a>`W$8H`8#?)dO*4WuAR$US2azd1HQ`5MVUoZ*;R z-{#pH(lpSGFyfg=-xV3Rlq>v@AoI%&>#?!=7DIB!1J&C z_B_V8-{v!s{^Y^pH#QH4tPxn>DE=sp^ZA4O@1B!;nQ_N|H1co%SvA7ugZcYv8}@79 z4~J0wGmt*-WnB~Fjz6ydd`3+lf9vOS{fs;Q zm{+zLxc>w1fo?j#4u(q1A@B54#7mkn=0;f zTHNm(l1YdUZ>XdBnR;0avjFhWw#$y(AwMV<#3!)zW__K$mj04mJ1fezL1YIjF_jHS%}j}n_;T7HP^3A{(H{cq z&}q~*9Pn-G#Ur`L30$9#PH!1TKvq|? zyUndW+V`-RpuOW(@2&0oL?E%Z-0F?#C)x;PnKI{b(|>*5?bierI9l_E8-28LV+(=o zr1joO!D|E-CapJaW}hOkC~19tbaEAe#YyX4UcW{NEJ<45{Pv?l-*3XA zp0IGUesw#JHPZdB1PpdLQ5!eq ecmg~Do&ZmPC%_Zn3Gf7X0z3hp08ijQN#HjhnJd%) diff --git a/boards/lolin32pro.csv b/boards/lolin32pro.csv index e95830ca..005454c8 100644 --- a/boards/lolin32pro.csv +++ b/boards/lolin32pro.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,lolin32pro.csv +L_COMMENT,data,string,This is the configuration for a lolin pro with wrover cpu. + gpio_space,namespace,, K_SPI,data,u8,1 P_MISO,data,u8,12 diff --git a/boards/new_psram.csv b/boards/new_psram.csv index 90f53322..b98de0a8 100644 --- a/boards/new_psram.csv +++ b/boards/new_psram.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,new_psram.csv +L_COMMENT,data,string,This is the standard simple configuration for a wrover . + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 @@ -46,7 +51,7 @@ O_DDMM_FLAG,data,u8,255 custom_ir_space,namespace,, K_UP,data,string, K_LEFT,data,string, -K_OK,data,string,0 +K_OK,data,string, K_RIGHT,data,string, K_DOWN,data,string, K_0,data,string, diff --git a/boards/odroid-go.csv b/boards/odroid-go.csv index fce06b3f..c5a4568c 100644 --- a/boards/odroid-go.csv +++ b/boards/odroid-go.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,odroid-go.csv +L_COMMENT,data,string,This is the standard configuration for an odroid-go board. + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 diff --git a/boards/pattern.csv b/boards/pattern.csv index dac78d63..81390b17 100644 --- a/boards/pattern.csv +++ b/boards/pattern.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,pattern.csv +L_COMMENT,data,string,pattern for all csv files + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 @@ -32,6 +37,17 @@ P_I2S_BCLK,data,u8,26 P_I2S_DATA,data,u8,22 P_ADC,data,u8,255 P_BACKLIGHT,data,u8,255 +P_TOUCH_CS,data,u8,16 +P_JOY_0,data,u8,255 +P_JOY_1,data,u8,255 +P_LED_GPIO,data,u8,4 + +option_space,namespace,, +O_LCD_TYPE,data,u8,255 +O_LCD_ROTA,data,u8,0 +O_LCD_OUT,data,u32,0 +O_DDMM_FLAG,data,u8,1 + custom_ir_space,namespace,, K_UP,data,string, K_LEFT,data,string, diff --git a/boards/standard_adb.csv b/boards/standard_adb.csv index 6f508b60..8dee71cb 100644 --- a/boards/standard_adb.csv +++ b/boards/standard_adb.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,standard_adb.csv +L_COMMENT,data,string,This is the standard default configuration as in the builtin conf. + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 @@ -39,9 +44,9 @@ P_BACKLIGHT,data,u8,255 option_space,namespace,, O_LCD_TYPE,data,u8,255 -O_LCD_ROTA,data,u8,255 -O_LCD_OUT,data,u32,255 -O_DDMM_FLAG,data,u8,255 +O_LCD_ROTA,data,u8,0 +O_LCD_OUT,data,u32,0 +O_DDMM_FLAG,data,u8,0 custom_ir_space,namespace,, K_UP,data,string, diff --git a/boards/standard_psram.csv b/boards/standard_psram.csv index fdd00383..f190ea47 100644 --- a/boards/standard_psram.csv +++ b/boards/standard_psram.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,standard_psram.csv +L_COMMENT,data,string,This is the standard configuration for a wrover. + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 diff --git a/boards/standard_touch.csv b/boards/standard_touch.csv index b55b9fc1..903d8094 100644 --- a/boards/standard_touch.csv +++ b/boards/standard_touch.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,"standard_touch.csv. " +L_COMMENT,data,string,This is the standard configuration with the touch screen added. + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 diff --git a/boards/test.csv b/boards/test.csv deleted file mode 100644 index 1f6495cf..00000000 --- a/boards/test.csv +++ /dev/null @@ -1,61 +0,0 @@ -key,type,encoding,value -gpio_space,namespace,, -K_SPI,data,u8,1 -P_MISO,data,u8,12 -P_MOSI,data,u8,13 -P_CLK,data,u8,14 -P_XCS,data,u8,255 -P_RST,data,u8,12 -P_XDCS,data,u8,33 -P_DREQ,data,u8,34 -P_ENC0_A,data,u8,18 -P_ENC0_B,data,u8,19 -P_ENC0_BTN,data,u8,4 -P_ENC1_A,data,u8,255 -P_ENC1_B,data,u8,17 -P_ENC1_BTN,data,u8,5 -P_BTN0_A,data,u8,255 -P_BTN0_B,data,u8,255 -P_BTN0_C,data,u8,255 -P_BTN1_A,data,u8,255 -P_BTN1_B,data,u8,255 -P_BTN1_C,data,u8,255 -P_I2C_SCL,data,u8,255 -P_I2C_SDA,data,u8,255 -P_I2C_RST,data,u8,255 -P_LCD_CS,data,u8,22 -P_LCD_A0,data,u8,23 -P_LCD_RST,data,u8,21 -P_IR_SIGNAL,data,u8,34 -P_I2S_LRCK,data,u8,25 -P_I2S_BCLK,data,u8,26 -P_I2S_DATA,data,u8,27 -P_ADC_KBD,data,u8,255 -P_BACKLIGHT,data,u8,255 - -option_space,namespace,, -O_LCD_TYPE,data,u8,255 -O_LCD_ROTA,data,u8,255 -O_LCD_OUT,data,u32,0 -O_DDMM_FLAG,data,u8,1 - -custom_ir_space,namespace,, -K_UP,data,string, -K_LEFT,data,string, -K_OK,data,string, -K_RIGHT,data,string, -K_DOWN,data,string, -K_0,data,string, -K_1,data,string, -K_2,data,string, -K_3,data,string, -K_4,data,string, -K_5,data,string, -K_6,data,string, -K_7,data,string, -K_8,data,string, -K_9,data,string, -K_STAR,data,string, -K_DIESE,data,string, -K_INFO,data,string, - diff --git a/boards/ttgot8.csv b/boards/ttgot8.csv index fa8ae577..71037d5f 100644 --- a/boards/ttgot8.csv +++ b/boards/ttgot8.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,ttgot8.csv +L_COMMENT,data,string,LilyGo/TTGO-T8 board . + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 diff --git a/boards/ttgotm.csv b/boards/ttgotm.csv index 80f55b0f..7e22a183 100644 --- a/boards/ttgotm.csv +++ b/boards/ttgotm.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,ttgotm.csv +L_COMMENT,data,string,LilyGO/TTGO-TM-ESP32 board . + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 diff --git a/boards/ttgov4.csv b/boards/ttgov4.csv index c3089790..7f3430a7 100644 --- a/boards/ttgov4.csv +++ b/boards/ttgov4.csv @@ -1,4 +1,9 @@ key,type,encoding,value + +label_space,namespace,, +L_LABEL,data,string,4csv +L_COMMENT,data,string,LilyGO/TTGO-T4 board . + gpio_space,namespace,, K_SPI,data,u8,2 P_MISO,data,u8,19 diff --git a/main/ClickButtons.c b/main/ClickButtons.c index 904f47d7..1c812f94 100644 --- a/main/ClickButtons.c +++ b/main/ClickButtons.c @@ -39,7 +39,7 @@ Button_t* ClickButtonsInit(int8_t A, int8_t B, int8_t C) enc->button[i] = Open; enc->keyDownTicks[i] = 0; enc->doubleClickTicks[i] = 0; - enc->lastButtonCheck[i] = 0; +// enc->lastButtonCheck[i] = 0; } enc->doubleClickEnabled = true; enc->buttonHeldEnabled = true; @@ -76,15 +76,15 @@ IRAM_ATTR void serviceBtn(Button_t *enc) { // handle enc->button // - unsigned long currentMillis = xTaskGetTickCount()* portTICK_PERIOD_MS; +// unsigned long currentMillis = xTaskGetTickCount()* portTICK_PERIOD_MS; for(uint8_t i = 0; i < 3; i++) { - if (currentMillis < enc->lastButtonCheck[i]) enc->lastButtonCheck[i] = 0; // Handle case when millis() wraps back around to zero - if ((enc->pinBTN[i] > 0 ) // check enc->button only, if a pin has been provided - && ((currentMillis - enc->lastButtonCheck[i]) >= ENC_BUTTONINTERVAL)) // checking enc->button is sufficient every 10-30ms +// if (currentMillis < enc->lastButtonCheck[i]) enc->lastButtonCheck[i] = 0; // Handle case when millis() wraps back around to zero + if ((enc->pinBTN[i] > 0 )) // check enc->button only, if a pin has been provided +// && ((currentMillis - enc->lastButtonCheck[i]) >= ENC_BUTTONINTERVAL)) // checking enc->button is sufficient every 10-30ms { - enc->lastButtonCheck[i] = currentMillis; +// enc->lastButtonCheck[i] = currentMillis; bool pinRead = getPinStates(enc,i); diff --git a/main/ClickEncoder.c b/main/ClickEncoder.c index e709dfaa..8174559b 100644 --- a/main/ClickEncoder.c +++ b/main/ClickEncoder.c @@ -129,40 +129,61 @@ bool getHalfStep(Encoder_t *enc) //void (*serviceEncoder)() = NULL; IRAM_ATTR void service(Encoder_t *enc) { - bool moved = false; + volatile bool moved = false; - if (enc->pinA >= 0 && enc->pinB >= 0) { - if (enc->accelerationEnabled) { // decelerate every tick - enc->acceleration -= ENC_ACCEL_DEC; - if (enc->acceleration & 0x8000) { // handle overflow of MSB is set - enc->acceleration = 0; - } - } +// if (enc->pinA >= 0 && enc->pinB >= 0) + { +// if (enc->accelerationEnabled) + { // decelerate every tick + enc->acceleration -= ENC_ACCEL_DEC; + if (enc->acceleration & 0x8000) + { // handle overflow of MSB is set + enc->acceleration = 0; +//enc->dcount++; + } + } - int8_t curr = 0; - if (digitalRead(enc->pinA) == enc->pinsActive) { + volatile int8_t curr = 0; + volatile int va,vb; + va = digitalRead(enc->pinA); + vb = digitalRead(enc->pinB); + +// if (digitalRead(enc->pinA) == enc->pinsActive) { +// if (digitalRead(enc->pinA) == 0) { + if (va == 0) { curr = 3; } - if (digitalRead(enc->pinB) == enc->pinsActive) { +// if (digitalRead(enc->pinB) == enc->pinsActive) { +// if (digitalRead(enc->pinB) == 0) { + if (vb == 0) { curr ^= 1; } - int8_t diff = enc->last - curr; + volatile int8_t diff = enc->last - curr; if (diff & 1) { // bit 0 = step +//printf("diff: %d cur: %d last: %d delta: %d\n",diff,curr,enc->last,enc->delta); +/* +enc->pcurr = curr; +enc->plast = enc->last; +enc->pdiff = diff; +enc->count++; +*/ enc->last = curr; enc->delta += (diff & 2) - 1; // bit 1 = direction (+/-) moved = true; +//enc->pdelta = enc->delta; } - if (enc->accelerationEnabled && moved) { + if (/*enc->accelerationEnabled &&*/ moved) { // increment accelerator if encoder has been moved - if (enc->acceleration <= (ENC_ACCEL_TOP - enc->accel_inc)) { - enc->acceleration += enc->accel_inc ; - } + if (enc->acceleration <= (ENC_ACCEL_TOP - enc->accel_inc)) { + enc->acceleration += enc->accel_inc ; +//enc->icount++; + } + } } -} // handle enc->button // unsigned long currentMillis = xTaskGetTickCount()* portTICK_PERIOD_MS; @@ -239,7 +260,18 @@ int16_t getValue(Encoder_t *enc) else if (val > 0) { r += 1 + accel; } -// if (r != 0) printf("Acceleration: %d accel: %d val:%d,, R:%d\n",enc->acceleration,accel,val,r); + +/* + if (r != 0) + { + printf("count: %d pdiff: %d pcur: %d plast: %d pdelta: %d\n",enc->count,enc->pdiff,enc->pcurr,enc->plast,enc->pdelta); + printf(" increment: %d decrement: %d\n",enc->icount,enc->dcount); + enc->count = 0; + enc->icount= 0; + enc->dcount=0; + printf("Acceleration: %d step: %d last: %d val:%d,, R:%d\n",enc->acceleration,enc->steps,enc->last,val,r); + } +*/ interrupts(); return r; diff --git a/main/ClickJoystick.c b/main/ClickJoystick.c index ea285fdb..8b3c0ea3 100644 --- a/main/ClickJoystick.c +++ b/main/ClickJoystick.c @@ -46,7 +46,7 @@ Joystick_t* ClickJoystickInit(int8_t A) enc->button[i] = Open; enc->keyDownTicks[i] = 0; enc->doubleClickTicks[i] = 0; - enc->lastButtonCheck[i] = 0; +// enc->lastButtonCheck[i] = 0; } enc->doubleClickEnabled = true; enc->buttonHeldEnabled = true; @@ -61,18 +61,16 @@ IRAM_ATTR void serviceJoystick(Joystick_t *enc) { // handle enc->button // - unsigned long currentMillis = xTaskGetTickCount()* portTICK_PERIOD_MS; +// unsigned long currentMillis = xTaskGetTickCount()* portTICK_PERIOD_MS; bool pinRead[NBBUTTONS]; getJoyStates(enc, pinRead); for(uint8_t i = 0; i < NBBUTTONS; i++) { - if (currentMillis < enc->lastButtonCheck[i]) enc->lastButtonCheck[i] = 0; // Handle case when millis() wraps back around to zero - if (((currentMillis - enc->lastButtonCheck[i]) >= ENC_BUTTONINTERVAL)) // checking enc->button is sufficient every 10-30ms +// if (currentMillis < enc->lastButtonCheck[i]) enc->lastButtonCheck[i] = 0; // Handle case when millis() wraps back around to zero +// if (((currentMillis - enc->lastButtonCheck[i]) >= ENC_BUTTONINTERVAL)) // checking enc->button is sufficient every 10-30ms { - enc->lastButtonCheck[i] = currentMillis; - - - +// enc->lastButtonCheck[i] = currentMillis; + if (pinRead[i] == true) { // key is down enc->keyDownTicks[i]++; if ((enc->keyDownTicks[i] > (BTN_HOLDTIME / ENC_BUTTONINTERVAL)) && (enc->buttonHeldEnabled)) @@ -98,17 +96,16 @@ IRAM_ATTR void serviceJoystick(Joystick_t *enc) else { enc->doubleClickTicks[i] = (enc->doubleClickEnabled) ? (BTN_DOUBLECLICKTIME / ENC_BUTTONINTERVAL) : ENC_SINGLECLICKONLY; } + } } - } - - enc->keyDownTicks[i] = 0; + enc->keyDownTicks[i] = 0; } if (enc->doubleClickTicks[i] > 0) { - enc->doubleClickTicks[i]--; - if (enc->doubleClickTicks[i] == 0) { - enc->button[i] = Clicked; - } + enc->doubleClickTicks[i]--; + if (enc->doubleClickTicks[i] == 0) { + enc->button[i] = Clicked; + } } } } diff --git a/main/addon.c b/main/addon.c index 64048478..bfa3c77c 100644 --- a/main/addon.c +++ b/main/addon.c @@ -54,7 +54,7 @@ static xTaskHandle pxTaskLcd; // list of screen typedef enum typeScreen {smain,svolume,sstation,snumber,stime,snull} typeScreen ; static typeScreen stateScreen = snull; -static typeScreen oldStateScreen = smain; +static typeScreen defaultStateScreen = smain; // state of the transient screen static uint8_t mTscreen = MTNEW; // 0 dont display, 1 display full, 2 display variable part @@ -94,8 +94,11 @@ static bool isButton0 = true; static bool isButton1 = true; static bool isJoystick0 = true; static bool isJoystick1 = true; + void Screen(typeScreen st); -static void evtDrawScreen(); +void drawScreen(); +static void evtScreen(typelcmd value); + Encoder_t* encoder0 = NULL; Encoder_t* encoder1 = NULL; Button_t* button0 = NULL; @@ -165,15 +168,13 @@ void wakeLcd() // add the gpio switch on here gpioLedBacklight can be directly a GPIO_NUM_xx or declared in gpio.h LedBacklightOn(); timerLcdOut = getLcdOut(); // rearm the tempo - if(((isColor) && (itLcdOut))|| mTscreen== MTNEW) { evtDrawScreen(); } - itLcdOut = 0; - - + if (itLcdOut) {mTscreen= MTNEW; evtScreen(defaultStateScreen);} + itLcdOut = 0; //0 not activated, 1 sleep requested, 2 in sleep } void sleepLcd() { - itLcdOut = 2; + itLcdOut = 2; // in sleep // add the gpio switch off here LedBacklightOff(); evtClearScreen(); @@ -252,10 +253,9 @@ IRAM_ATTR void ServiceAddon(void) if ((timestamp % (10*DTIDLE))==0){ itAskTime=true;} // synchronise with ntp every x*DTIDLE if (((timein % DTIDLE)==0)&&(!state) ) { - {itAskStime=true;timein = 0;} // start the time display + {itAskStime=true;timein = 0;} // start the time display when paused } - if (timerLcdOut == 1) itLcdOut = 1; - if ((stateScreen == stime)||(stateScreen == smain)) { mTscreen = MTREFRESH; } // display time + if (timerLcdOut == 1) itLcdOut = 1; // ask to go to sleep if (!syncTime) itAskTime=true; // first synchro if not done timer1s = 0; @@ -288,16 +288,25 @@ void scroll() // Change the current screen //////////////////////////// void Screen(typeScreen st){ +//printf("Screen: st: %d, stateScreen: %d, mTscreen: %d, default: %d\n",st,stateScreen,mTscreen,defaultStateScreen); if (stateScreen != st) { - oldStateScreen = stateScreen; mTscreen = MTNEW; + wakeLcd(); } else + { if (mTscreen == MTNODISPLAY) mTscreen = MTREFRESH; + } + +// printf("Screenout: st: %d, stateScreen: %d, mTscreen: %d, default: %d, timerScreen: %d \n",st,stateScreen,mTscreen,defaultStateScreen,timerScreen); + stateScreen = st; - timein = 0; -// printf("st: %d, mTscreen: %d, old: %d\n",st,mTscreen,oldStateScreen); + timein = 0; + timerScreen = 0; + drawScreen(); +//printf("Screendis: st: %d, stateScreen: %d, mTscreen: %d, default: %d\n",st,stateScreen,mTscreen,defaultStateScreen); +// vTaskDelay(1); } @@ -320,7 +329,8 @@ void drawTTitle(char* ttitle) // draw the number entered from IR void drawNumber() { - isColor?drawNumberUcg(mTscreen,irStr):drawNumberU8g2(mTscreen,irStr); + if (strlen(irStr) >0) + isColor?drawNumberUcg(mTscreen,irStr):drawNumberU8g2(mTscreen,irStr); } @@ -358,7 +368,8 @@ void drawStation() playable = true; } while (playable == false); - //drawTTitle(ststr); + //drawTTitle(ststr); +//printf ("drawStation: %s\n",sNum ); isColor?drawStationUcg(mTscreen,sNum,ddot):drawStationU8g2(mTscreen,sNum,ddot); free (si); } @@ -404,10 +415,11 @@ void drawScreen() drawNumber(); break; default: - Screen(smain); - drawFrame(); - } - mTscreen = MTNODISPLAY; + Screen(defaultStateScreen); +// drawFrame(); + } +// if (mTscreen == MTREFRESH) + mTscreen = MTNODISPLAY; } } @@ -443,9 +455,6 @@ void stationOk() } void changeStation(int16_t value) { -// Screen(sstation); -// wakeLcd(); - timerScreen = 0; currentValue = value; if (value > 0) futurNum++; if (futurNum > 254) futurNum = 0; @@ -457,25 +466,14 @@ void changeStation(int16_t value) // a number of station in progress... void nbStation(char nb) { - Screen(snumber); - timerScreen = 0; if (strlen(irStr)>=3) irStr[0] = 0; uint8_t id = strlen(irStr); irStr[id] = nb; irStr[id+1] = 0; + evtScreen(snumber); } // - -static void evtDrawScreen() -{ - event_lcd_t evt; - evt.lcmd = edraw; - evt.lline = NULL; -// xQueueSendToFront(event_lcd,&evt, 0); - xQueueSend(event_lcd,&evt, 0); -} - static void evtClearScreen() { // isColor?ucg_ClearScreen(&ucg):u8g2_ClearDisplay(&u8g2); @@ -486,13 +484,18 @@ static void evtClearScreen() xQueueSend(event_lcd,&evt, 0); } - -static void evtStation(int16_t value) +static void evtScreen(typelcmd value) { event_lcd_t evt; -// wakeLcd(); -// if (stateScreen != sstation) evtClearScreen(); - timerScreen = 0; + evt.lcmd = escreen; + evt.lline = (char*)((uint32_t)value); + xQueueSend(event_lcd,&evt, 0); + +} + +static void evtStation(int16_t value) +{ // value +1 or -1 + event_lcd_t evt; evt.lcmd = estation; evt.lline = (char*)((uint32_t)value); xQueueSend(event_lcd,&evt, 0); @@ -638,8 +641,7 @@ void adcLoop() { // double click = toggle time if (state0 == DoubleClicked) toggletime(); if (state0 == Held) - { - timerScreen = 0; + { if (stateScreen!= (role?sstation:svolume)) { role?evtStation(newValue):setRelVolume(newValue); @@ -688,15 +690,12 @@ void encoderCompute(Encoder_t *enc,bool role) // if an event on encoder switch if (newButton != Open) { -// wakeLcd(); - // clicked = startstop if (newButton == Clicked) {startStop();} // double click = toggle time if (newButton == DoubleClicked) { toggletime();} // switch held and rotated then change station if ((newButton == Held)&&(getPinState(enc) == getpinsActive(enc))) - { - timerScreen = 0; + { if (stateScreen!= (role?sstation:svolume)) role?evtStation(newValue):setRelVolume(newValue); } @@ -777,7 +776,7 @@ event_ir_t evt; ESP_LOGI(TAG,"IR event: Channel: %x, ADDR: %x, CMD: %x = %X, REPEAT: %d",evt.channel,evt.addr,evt.cmd, evtir,evt.repeat_flag ); if (isCustomKey){ - if (irCustom(evtir,evt.repeat_flag)) break; + if (irCustom(evtir,evt.repeat_flag)) continue; } else{ // no predefined keys switch(evtir) @@ -950,17 +949,21 @@ int tx,ty; } } - +static uint8_t divide = 0; // indirect call to service -IRAM_ATTR void multiService() +IRAM_ATTR void multiService() // every 1ms { if (isEncoder0) service(encoder0); if (isEncoder1) service(encoder1); - if (isButton0) serviceBtn(button0); - if (isButton1) serviceBtn(button1); - if (isJoystick0) serviceJoystick(joystick0); - if (isJoystick1) serviceJoystick(joystick1); ServiceAddon(); + if (divide++ == 10) // only every 10ms + { + if (isButton0) serviceBtn(button0); + if (isButton1) serviceBtn(button1); + if (isJoystick0) serviceJoystick(joystick0); + if (isJoystick1) serviceJoystick(joystick1); + divide = 0; + } } //-------------------- // LCD display task @@ -971,18 +974,17 @@ void task_lcd(void *pvParams) event_lcd_t evt ; // lcd event event_lcd_t evt1 ; // lcd event ESP_LOGD(TAG, "task_lcd Started, LCD Type %d",lcd_type); + defaultStateScreen = (g_device->options32&T_TOGGLETIME)? stime:smain; + drawFrame(); + while (1) { if (itLcdOut==1) // switch off the lcd { sleepLcd(); } - if (itAskStime) // time start the time display. Don't do that in interrupt. - { - Screen(stime); - itAskStime = false; - } - if (timerScroll >= 500) // + + if (timerScroll >= 500) //500 ms { if (lcd_type != LCD_NONE) { @@ -990,6 +992,8 @@ void task_lcd(void *pvParams) { scroll(); } + if ((stateScreen == stime)||(stateScreen == smain)) {mTscreen = MTREFRESH; } // display time + drawScreen(); } timerScroll = 0; @@ -1000,33 +1004,29 @@ void task_lcd(void *pvParams) if (evt.lcmd != lmeta) ESP_LOGV(TAG,"event_lcd: %x",(int)evt.lcmd); else - ESP_LOGV(TAG,"event_lcd: %x %s",(int)evt.lcmd,evt.lline); + ESP_LOGV(TAG,"event_lcd: %x %s",(int)evt.lcmd,evt.lline); switch(evt.lcmd) { case lmeta: - Screen(smain); isColor?metaUcg(evt.lline):metaU8g2(evt.lline); -// mTscreen= MTREFRESH; - wakeLcd(); + Screen(smain); + wakeLcd(); break; case licy4: isColor?icy4Ucg(evt.lline):icy4U8g2(evt.lline); break; - case licy0: -// wakeLcd(); + case licy0: isColor?icy0Ucg(evt.lline):icy0U8g2(evt.lline); break; case lstop: - Screen(smain); isColor?statusUcg(stopped):statusU8g2(stopped); -// mTscreen= MTNEW; + Screen(smain); wakeLcd(); break; case lnameset: - Screen(smain); isColor?namesetUcg(evt.lline):namesetU8g2(evt.lline); isColor?statusUcg("STARTING"):statusU8g2("STARTING"); - mTscreen= MTNEW; + Screen(smain); wakeLcd(); break; case lplay: @@ -1041,43 +1041,40 @@ void task_lcd(void *pvParams) { Screen(svolume); wakeLcd(); } - dvolume = true; - timerScreen = 0; + dvolume = true; break; case lovol: -// wakeLcd(); dvolume = false; // don't show volume on start station break; case estation: wakeLcd(); if(xQueuePeek(event_lcd, &evt1, 0)) if (evt1.lcmd == estation) {evt.lline = NULL;break;} - Screen(sstation); changeStation((uint32_t)evt.lline); + Screen(sstation); evt.lline = NULL; // just a number break; case eclrs: isColor?ucg_ClearScreen(&ucg):u8g2_ClearDisplay(&u8g2); break; - case etoggle: -// wakeLcd(); -// isColor?ucg_ClearScreen(&ucg):u8g2_ClearDisplay(&u8g2); - (stateScreen==smain)?Screen(stime):Screen(smain); - mTscreen= MTNEW; + case escreen: + Screen((uint32_t)evt.lline); wakeLcd(); -// drawScreen(); + evt.lline = NULL; // just a number Don't free break; - case edraw: // force redraw - itLcdOut = 0; - mTscreen = MTNEW; - drawScreen(); + case etoggle: + defaultStateScreen = (stateScreen==smain)?stime:smain; + (stateScreen==smain)?Screen(stime):Screen(smain); + g_device->options32 = (defaultStateScreen== smain)?g_device->options32&NT_TOGGLETIME:g_device->options32|T_TOGGLETIME; + saveDeviceSettings(g_device); break; default:; } if (evt.lline != NULL) free(evt.lline); - vTaskDelay(1); - } - vTaskDelay(5); + vTaskDelay(1); + } + if ((event_lcd)&&(!uxQueueMessagesWaiting(event_lcd))) vTaskDelay(4); + vTaskDelay(1); } vTaskDelete( NULL ); } @@ -1110,8 +1107,8 @@ void task_addon(void *pvParams) xTaskCreatePinnedToCore (task_lcd, "task_lcd", 2200, NULL, PRIO_LCD, &pxTaskLcd,CPU_LCD); ESP_LOGI(TAG, "%s task: %x","task_lcd",(unsigned int)pxTaskLcd); getTaskLcd(&pxTaskLcd); // give the handle to xpt - vTaskDelay(1); - wakeLcd(); +// vTaskDelay(1); +// wakeLcd(); while (1) { @@ -1119,7 +1116,7 @@ void task_addon(void *pvParams) encoderLoop(); // compute the encoder buttonsLoop(); // compute the buttons and joysticks irLoop(); // compute the ir - touchLoop(); + touchLoop(); // compute the touch screen if (itAskTime) // time to ntp. Don't do that in interrupt. { if (ntp_get_time(&dt) ) @@ -1133,10 +1130,11 @@ void task_addon(void *pvParams) if (timerScreen >= 3) // sec timeout transient screen { - timerScreen = 0; - if ((stateScreen != smain)&&(stateScreen != stime)&&(stateScreen != snull)) +// if ((stateScreen != smain)&&(stateScreen != stime)&&(stateScreen != snull)) +//printf("timerScreen: %d, stateScreen: %d, defaultStateScreen: %d\n",timerScreen,stateScreen,defaultStateScreen); + timerScreen = 0; + if ((stateScreen != defaultStateScreen)&&(stateScreen != snull)) { - Screen(oldStateScreen); //Back the the old screen // Play the changed station on return to main screen // if a number is entered, play it. if (strlen(irStr) >0){ @@ -1151,11 +1149,23 @@ void task_addon(void *pvParams) && ( futurNum!= atoi( isColor?getNameNumUcg():getNameNumU8g2() ))) { playStationInt(futurNum); - } + vTaskDelay(10); + } + if (!itAskStime) + { + if ((defaultStateScreen == stime) && (stateScreen != smain))evtScreen(smain); + else + if ((defaultStateScreen == stime) && (stateScreen == smain))evtScreen(stime); + else + if (stateScreen != defaultStateScreen) + evtScreen(defaultStateScreen); //Back to the old screen + } } + if (itAskStime&&(stateScreen != stime)) // time start the time display. Don't do that in interrupt. + evtScreen(stime); } - vTaskDelay(10); + vTaskDelay(20); } vTaskDelete( NULL ); } @@ -1236,6 +1246,7 @@ void addonParse(const char *fmt, ...) if ((ici=strstr(line,"YING#")) != NULL) { state = true; + itAskStime = false; evt.lcmd = lplay; evt.lline = NULL; // xQueueSend(event_lcd,&evt, 0); diff --git a/main/app_main.c b/main/app_main.c index cdf738a8..850d5879 100644 --- a/main/app_main.c +++ b/main/app_main.c @@ -120,7 +120,7 @@ static bool bigRam = false; // timeout to save volume in flash static uint32_t ctimeVol = 0; static uint32_t ctimeMs = 0; - +static bool divide = false; // disable 1MS timer interrupt IRAM_ATTR void noInterrupt1Ms() {timer_disable_intr(TIMERGROUP1MS, msTimer);} // enable 1MS timer interrupt @@ -148,18 +148,20 @@ IRAM_ATTR void microsCallback(void *pArg) { // IRAM_ATTR bool bigSram() { return bigRam;} //----------------------------------- +// every 500µs IRAM_ATTR void msCallback(void *pArg) { int timer_idx = (int) pArg; + // queue_event_t evt; TIMERG1.hw_timer[timer_idx].update = 1; TIMERG1.int_clr_timers.t0 = 1; //isr ack -// evt.type = TIMER_1MS; -// evt.i1 = TIMERGROUP1MS; -// evt.i2 = timer_idx; + if (divide) + { ctimeMs++; // for led - ctimeVol++; // to save volume + ctimeVol++; // to save volume + } + divide = !divide; if (serviceAddon != NULL) serviceAddon(); // for the encoders and buttons -// xQueueSendFromISR(event_queue, &evt, NULL); TIMERG1.hw_timer[timer_idx].config.alarm_en = 1; } @@ -237,7 +239,7 @@ timer_config_t config; ESP_ERROR_CHECK(timer_isr_register(TIMERGROUP, wakeTimer, wakeCallback, (void*) wakeTimer, 0, NULL)); /*Configure timer 1MS*/ config.auto_reload = TIMER_AUTORELOAD_EN; - config.divider = TIMER_DIVIDER1MS; + config.divider = TIMER_DIVIDER1MS ; ESP_ERROR_CHECK(timer_init(TIMERGROUP1MS, msTimer, &config)); ESP_ERROR_CHECK(timer_pause(TIMERGROUP1MS, msTimer)); ESP_ERROR_CHECK(timer_isr_register(TIMERGROUP1MS, msTimer, msCallback, (void*) msTimer, 0, NULL)); diff --git a/main/gpio.c b/main/gpio.c index a3e3f9df..6946265c 100644 --- a/main/gpio.c +++ b/main/gpio.c @@ -17,6 +17,7 @@ static xSemaphoreHandle muxnvs= NULL; const char hardware[] = {"hardware"}; const char option_space[] = {"option_space"}; const char gpio_space[] = {"gpio_space"}; +const char label_space[] = {"label_space"}; // init a gpio as output void gpio_output_conf(gpio_num_t gpio) @@ -58,6 +59,44 @@ void close_partition(nvs_handle handle,const char *partition_label) xSemaphoreGive(muxnvs); } +void gpio_get_label(char** label) +{ + size_t required_size; + nvs_handle hardware_handle; + if (open_partition(hardware, label_space,NVS_READONLY,&hardware_handle)!= ESP_OK) + { + ESP_LOGD(TAG,"in get label"); + return; + } + nvs_get_str(hardware_handle, "L_LABEL", NULL, &required_size); + if (required_size >1) + { + *label = malloc(required_size); + nvs_get_str(hardware_handle, "L_LABEL", *label, &required_size); + ESP_LOGV(TAG,"Label: \"%s\"\n Required size: %d",*label,required_size); + } + close_partition(hardware_handle,hardware); +} + +void gpio_get_comment(char** label) +{ + size_t required_size; + nvs_handle hardware_handle; + if (open_partition(hardware, label_space,NVS_READONLY,&hardware_handle)!= ESP_OK) + { + ESP_LOGD(TAG,"in get label"); + return; + } + nvs_get_str(hardware_handle, "L_COMMENT", NULL, &required_size); + if (required_size >1) + { + *label = malloc(required_size); + nvs_get_str(hardware_handle, "L_COMMENT", *label, &required_size); + ESP_LOGV(TAG,"Label: \"%s\"\n Required size: %d",*label,required_size); + } + close_partition(hardware_handle,hardware); +} + void gpio_get_spi_bus(uint8_t *spi_no,gpio_num_t *miso,gpio_num_t *mosi,gpio_num_t *sclk) { esp_err_t err; diff --git a/main/include/ClickButtons.h b/main/include/ClickButtons.h index c39e5897..a0975387 100644 --- a/main/include/ClickButtons.h +++ b/main/include/ClickButtons.h @@ -62,7 +62,7 @@ typedef gpio_mode_t pinMode_t; bool buttonHeldEnabled; uint16_t keyDownTicks[3] ; uint16_t doubleClickTicks[3] ; - unsigned long lastButtonCheck[3]; +// unsigned long lastButtonCheck[3]; } Button_t; diff --git a/main/include/ClickEncoder.h b/main/include/ClickEncoder.h index 1986db89..2f7c7685 100644 --- a/main/include/ClickEncoder.h +++ b/main/include/ClickEncoder.h @@ -60,7 +60,7 @@ typedef gpio_mode_t pinMode_t; volatile int16_t last; volatile uint8_t steps; volatile uint8_t accel_inc; - volatile uint16_t acceleration; + volatile int16_t acceleration; bool accelerationEnabled; volatile Button button; bool doubleClickEnabled; @@ -68,6 +68,16 @@ typedef gpio_mode_t pinMode_t; uint16_t keyDownTicks ; uint16_t doubleClickTicks ; unsigned long lastButtonCheck ; + + //printf("diff: %d cur: %d last: %d delta: %d\n",diff,curr,enc->last,enc->delta); +/* int8_t pcurr; + int16_t plast; + int8_t pdiff; + uint16_t count; + uint16_t icount; + uint16_t dcount; + int16_t pdelta; +*/ } Encoder_t; diff --git a/main/include/ClickJoystick.h b/main/include/ClickJoystick.h index a38797e0..6003d4f5 100644 --- a/main/include/ClickJoystick.h +++ b/main/include/ClickJoystick.h @@ -63,7 +63,7 @@ typedef gpio_mode_t pinMode_t; bool buttonHeldEnabled; uint16_t keyDownTicks[NBBUTTONS] ; uint16_t doubleClickTicks[NBBUTTONS] ; - unsigned long lastButtonCheck[NBBUTTONS]; +// unsigned long lastButtonCheck[NBBUTTONS]; } Joystick_t; diff --git a/main/include/addon.h b/main/include/addon.h index 1fb82b35..0ef10d6b 100644 --- a/main/include/addon.h +++ b/main/include/addon.h @@ -66,7 +66,7 @@ typedef struct { bool repeat_flag; } event_ir_t; -typedef enum typelcmd {lstop,lplay,lmeta,licy0,licy4,lnameset,lvol,lovol,estation,eclrs,edraw,etoggle} typelcmd; +typedef enum typelcmd {lstop,lplay,lmeta,licy0,licy4,lnameset,lvol,lovol,estation,eclrs,edraw,etoggle,escreen,erefresh} typelcmd; typedef struct { typelcmd lcmd; /*!< For what ?*/ char* lline; /*!< string of command */ diff --git a/main/include/eeprom.h b/main/include/eeprom.h index f14664a5..035e8e5a 100644 --- a/main/include/eeprom.h +++ b/main/include/eeprom.h @@ -29,6 +29,8 @@ #define NT_ENC1 0xF7 #define T_WIFIAUTO 0x10 #define NT_WIFIAUTO 0xEF +#define T_TOGGLETIME 0x20 +#define NT_TOGGLETIME 0xDF #define APMODE 0 #define STA1 1 @@ -75,6 +77,7 @@ struct device_settings { uint32_t lcd_out; // timeout in seconds to switch off the lcd. 0 = no timeout uint8_t options32; // bit0:0 = MMDD, 1 = DDMM in the time display, bit1: 0= lcd without rotation 1 = lcd rotated 180 // bit 2: Half step of encoder0, bit3: Half step of encoder1, bit4: wifi auto reconnect + // bit5: TOGGLE time or main sreen char hostname[HOSTLEN]; uint32_t tp_calx; uint32_t tp_caly; diff --git a/main/include/gpio.h b/main/include/gpio.h index e9851ad7..6f469ac5 100644 --- a/main/include/gpio.h +++ b/main/include/gpio.h @@ -115,6 +115,8 @@ void gpio_output_conf(gpio_num_t gpio); // get the hardware partition infos esp_err_t open_partition(const char *partition_label, const char *namespace,nvs_open_mode open_mode,nvs_handle *handle); void close_partition(nvs_handle handle,const char *partition_label); +void gpio_get_label(char** label); +void gpio_get_comment(char** label); void gpio_get_spi_bus(uint8_t *spi_no,gpio_num_t *miso,gpio_num_t *mosi,gpio_num_t *sclk); void gpio_get_vs1053(gpio_num_t * xcs,gpio_num_t *rst,gpio_num_t *xdcs,gpio_num_t *dreq); void gpio_get_encoders(gpio_num_t *enca, gpio_num_t *encb, gpio_num_t *encbtn, gpio_num_t *enca1, gpio_num_t *encb1, gpio_num_t *encbtn1); diff --git a/main/include/interface.h b/main/include/interface.h index a350189e..dcdc5d17 100644 --- a/main/include/interface.h +++ b/main/include/interface.h @@ -17,7 +17,7 @@ #define RELEASE "1.9" -#define REVISION "0" +#define REVISION "1" uint32_t checkUart(uint32_t speed); extern unsigned short adcdiv; diff --git a/main/interface.c b/main/interface.c index 7b334ec2..fc15fb45 100644 --- a/main/interface.c +++ b/main/interface.c @@ -122,6 +122,7 @@ sys.henc0 or sys.henc1: Display the current step setting for the encoder. Normal sys.hencx(\"y\") with y=0 Normal, y=1 Half\n\ sys.cali[brate]: start a touch screen calibration\n\ sys.ledpola and sys.ledpola(\"x\"): display or set the polarity of the system led\n\ +sys.conf: Display the label of the csv file\n\ ///////////\n\ Other\n\ ///////////\n\ @@ -1169,6 +1170,27 @@ void fmUnmute() {RDA5807M_unmute(RDA5807M_TRUE);} */ +void sys_conf() +{ + char* label ; + kprintf("##CONFIG#\n"); + gpio_get_label(&label); + kprintf("#LABEL: "); + if (label != NULL) + { + kprintf("%s\n",label); + free (label); + } else kprintf("no label\n"); + gpio_get_comment(&label); + + kprintf("#COMMENT: "); + if (label != NULL) + { + kprintf("%s\n",label); + free (label); + } else kprintf("no comment\n"); +} + void checkCommand(int size, char* s) { char *tmp = (char*)malloc((size+1)*sizeof(char)); @@ -1235,6 +1257,7 @@ void checkCommand(int size, char* s) else if(strcmp(tmp+4, "erase") == 0) eeEraseAll(); else if(strcmp(tmp+4, "heap") == 0) heapSize(); else if(strcmp(tmp+4, "boot") == 0) esp_restart(); + else if(strcmp(tmp+4, "conf") == 0) sys_conf(); else if(strcmp(tmp+4, "update") == 0) update_firmware((char*)"KaRadio32"); else if(strcmp(tmp+4, "prerelease") == 0) update_firmware((char*)"KaRadio32prv"); else if(startsWith ( "patch",tmp+4)) syspatch(tmp);