souldiver / open9x

Automatically exported from code.google.com/p/open9x
0 stars 0 forks source link

Enhancement; Would love to have PWM_Backlight dimming feature; Code included #193

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which board (stock / gruvin9x / sky9x) are you using?
stock

What is your open9x FW version?
r1919 (patched)

What is your open9x EEPROM version?
212-3 (patched)

What steps will reproduce the problem?
no problem

What is the expected output? What do you see instead?
faljse published an excellent patch to add dimming feature for backlight.
I applied the patch to current version and it's workling really nice.
I like the fading and want to fade out slower than fade in. So I modified it a 
little bit, so fade out is now 8x slower than fade in.

Please provide any additional information below.
Original patch and patched r1919 (with slower fadeout modification) is attached.

Of course only if compile option is given. I changed the makefile to default 
opt it out.

Original issue reported on code.google.com by open.20.fsguruh@xoxy.net on 5 Feb 2013 at 7:37

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by bson...@gmail.com on 6 Feb 2013 at 8:32

GoogleCodeExporter commented 8 years ago

Original comment by bson...@gmail.com on 6 Feb 2013 at 9:15

GoogleCodeExporter commented 8 years ago
Only translations (other than en.h) missing

Original comment by bson...@gmail.com on 6 Feb 2013 at 8:29

GoogleCodeExporter commented 8 years ago
Sorry I forgot to mention, the german translation is included in the download I 
attached. Just use the de.h. Thanks!

Original comment by open.20.fsguruh@xoxy.net on 6 Feb 2013 at 8:39

GoogleCodeExporter commented 8 years ago
Would you prepare the other files for me (in english of course)?

Original comment by bson...@gmail.com on 6 Feb 2013 at 8:49

GoogleCodeExporter commented 8 years ago
I tried today r1929: I noticed a few things:
- makefile as a small fault: it's not audio, its voice which could not be 
combined to PWM_BACKLIGHT --> see attached zip file for a corrected makefile
- original patch wasn't perfect, because it wasts memory, the table should not 
be uint16_t it should be uint8_t in board_stock.cpp; So change type of pwmtable 
and all variables used in board_stock.cpp; This change saved me 38 bytes 
program.
- If you like you can use my patch (2nd patch) which reduces fadeout speed by 
  factor 8
- I improved it further to reach a full blink effect in case of warnings; but 
this needs changing back g_eeGeneral.blOnBright reversing; I know this ensures 
on light is brighter than off, but what matters... It would not break anything 
and saves further memory
   --> costs 98 bytes program and 1 byte data

Original comment by open.20.fsguruh@xoxy.net on 7 Feb 2013 at 8:25

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by bson...@gmail.com on 7 Feb 2013 at 10:04

GoogleCodeExporter commented 8 years ago
I will commit a part of the patch later. I will let you provide a new diff with 
things I have forgotten. I stopped when I saw that the default value was not 0. 
It should be 0  for both OFF and ON fields in the structure.

Original comment by bson...@gmail.com on 8 Feb 2013 at 6:23

GoogleCodeExporter commented 8 years ago
Please post again the next patch applied to the current SVN, I will reopen the 
issue

Original comment by bson...@gmail.com on 8 Feb 2013 at 11:18

GoogleCodeExporter commented 8 years ago
Did it. Added translation for all missing languages (google helped me).
Further small bugfix pgm_read_word -> pgm_read_byte because table has now bytes.
All done in attached diff files to revision 1934.
Three variants:
1)
pwm_backlightfix1.diff -> only language and pgm_read fix

2)
pwm_backlightRecalcRemoved.diff -> like fix1 but removed the recalculation and 
saved further 24 bytes of program; 
I don't thinks it worth starting with max bright? Spending a default value 
causes less than 24 bytes if needed

3)pwm_backlightfixSlowFadeOut.diff -> like fix2 but added slower fadout (8x 
slower than fadein); And increased blink effect; costs 114 program and 1 byte 
data

Original comment by open.20.fsguruh@xoxy.net on 8 Feb 2013 at 8:40

Attachments:

GoogleCodeExporter commented 8 years ago
The only constraint I would like is that 0 is the default value for ON and OFF 
bright. Thus the (15 - xxx) formula in 2 different places

Original comment by bson...@gmail.com on 9 Feb 2013 at 9:22

GoogleCodeExporter commented 8 years ago

Original comment by bson...@gmail.com on 9 Feb 2013 at 9:22

GoogleCodeExporter commented 8 years ago
Thanks for including my patch :)

I noticed a issue introduced by the uint_8 change:
pgm_read_word() should also be changed to pgm_read_byte() in fadeBacklight()

faljse

Original comment by martin.m...@gmail.com on 12 Feb 2013 at 9:49

GoogleCodeExporter commented 8 years ago
Hi Martin.m

great work anyway. Thanks again. Yes I noticed the same fault as well and 
provided already a patch also including all translations. Don't know when 
bsongis have time to put it in. But won't be too long.
In the meantime just use one of the patches provided in my comment on #10

Original comment by open.20.fsguruh@xoxy.net on 12 Feb 2013 at 4:38

GoogleCodeExporter commented 8 years ago
Done. Let me know if I forgot anything

Original comment by bson...@gmail.com on 13 Feb 2013 at 8:31