1 hour ago, Lorcan said:
The screensaver is a great idea, the life of these things is a few years at most and I’d prefer not to replace them that often. May I ask how you implemented that ?
with mios:
on every input (button press) of a UI-Task (DIN_BLM, DIN, ENC,) except of AIN (to much datamess when faders are going bad…)
i reset the energy-save timer (4minutes for example) to 0… looking like this:
void DIN\_BLM\_NotifyToggle(u32 pin, u32 pin\_value){ // Wakeup the Energy-Saver (BLM+LCD) // if it is in save-mode then dump out normal LCD-Labels if(flag.energy\_save == 1){ flag.energy\_save = 0; flag.clear\_LCD0 = 1; flag.clear\_LCD1 = 1; flag.clear\_LCD2 = 1; flag.clear\_LCD3 = 1; flag.clear\_LCD4 = 1; flag.clear\_LCD5 = 1; flag.clear\_LCD6 = 1; flag.clear\_LCD7 = 1; flag.clear\_LCD8 = 1; Router(5,0,0,0); Router(7,0,0,0); Router(99,0,0,0);} flag.energy\_reset = 1; flag.energy\_save = 0; flag.energy\_lcd = 0; flag.energy\_blm = 0; flag.energy\_led = 0; ... normal UI things... }
in the low priority task"App Background" it is steady counting until 4000seconds are gone… then activate the Energy-Save.. like this:
void APP\_Background(void){ // Screen & LED - Energy Saver // reduce rate static int e\_rate = 0; e\_rate++; if(e\_rate \> 1000){ e\_rate = 0;// reset counter 1000 ~= 1second static int e\_cnt = 0; if(flag.energy\_reset == 1){ flag.energy\_reset = 0; e\_cnt = 0; } if(flag.energy\_save == 0){ e\_cnt++; } if(e\_cnt \> Screensaver\_time\_sec){ e\_cnt = 0; flag.energy\_save = 1; flag.energy\_blm = 1; flag.energy\_lcd = 1; flag.energy\_led = 1;Router(5,0,0,0); }// Update BLM} // turn of BLM and LCD //MIOS32\_MIDI\_SendDebugMessage("e\_cnt: %d save: %d blm: %d", e\_cnt, flag.energy\_save, flag.energy\_blm); } }
then i made a rtos task (LCD(void…) … on low priority… where all my LCDs are handled…
in energy-save mode: print “spaces” aka clear screen - 1time > instead of update and handle (flags…) normal LCD/menue things…
static void LCD(void \*pvParameters) { portTickType xLastExecutionTime; xLastExecutionTime = xTaskGetTickCount(); while( 1 ) { vTaskDelayUntil(&xLastExecutionTime, 10 / portTICK\_RATE\_MS); // Energy Saver - CLEAR SCREENS if(flag.energy\_save == 1&& flag.energy\_lcd == 1){ flag.energy\_lcd = 0; // kill flag MIOS32\_LCD\_FontInit((u8 \*)fnt\_BIG);// use big custom font MUTEX\_LCD\_TAKE; MIOS32\_LCD\_DeviceSet( 0 ); MIOS32\_LCD\_CursorSet(0, 0); MIOS32\_LCD\_PrintFormattedString(" "); // aka CLEAR SCREEN MIOS32\_LCD\_CursorSet(0, 1); MIOS32\_LCD\_PrintFormattedString(" "); MIOS32\_LCD\_CursorSet(0, 2); MIOS32\_LCD\_PrintFormattedString(" "); MIOS32\_LCD\_CursorSet(0, 3); MIOS32\_LCD\_PrintFormattedString(" "); MUTEX\_LCD\_GIVE; } }
in normal operation the LCD-task do such things..:
static void LCD(void \*pvParameters) { portTickType xLastExecutionTime; xLastExecutionTime = xTaskGetTickCount(); while( 1 ) { vTaskDelayUntil(&xLastExecutionTime, 10 / portTICK\_RATE\_MS); // Energy Saver - OFF AND There is no Temporal Message showing (2 seconds...) if(flag.energy\_save == 0&& flag.Update\_LCD\_s == 0){ if(flag.clear\_LCD8 == 1) {// Menue LCD flag.clear\_LCD8 = 0;// kill Flag /// MENUE //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Beat Name - SHOW and EDIT if(Menue== 0){ MUTEX\_LCD\_TAKE; MIOS32\_LCD\_DeviceSet(8 ); MIOS32\_LCD\_FontInit((u8 \*)fnt\_BIG);// use big custom font MIOS32\_LCD\_CursorSet(0, 0); MIOS32\_LCD\_PrintFormattedString(" ");// clear MIOS32\_LCD\_CursorSet(0, 1); MIOS32\_LCD\_PrintFormattedString("%c%c%c%c%c%c%c%c", beat.name[0],beat.name[1],beat.name[2],beat.name[3],beat.name[4],beat.name[5],beat.name[6],beat.name[7]); MIOS32\_LCD\_CursorSet(0, 2); MIOS32\_LCD\_PrintFormattedString(" ");// clear MIOS32\_LCD\_CursorSet(0, 3); MIOS32\_LCD\_PrintFormattedString(" ");// clear MIOS32\_LCD\_CursorSet(cursor,2); MIOS32\_LCD\_PrintFormattedString("^");// show CURSOR MIOS32\_LCD\_FontInit((u8 \*)GLCD\_FONT\_NORMAL);// use tiny font MIOS32\_LCD\_CursorSet(0, 0); MIOS32\_LCD\_PrintFormattedString(" Beat Name %d", Menue); MIOS32\_LCD\_CursorSet(0, 7); MIOS32\_LCD\_PrintFormattedString("cursor letter"); MUTEX\_LCD\_GIVE; } ..... }
i do that also for LEDs and the BLM…
about Hottnes… thx for tip… i will also implement a Vreg in now… not that it dies when i am in a great jam…