Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: POKITTO_CORE/PokittoCore.cpp
- Revision:
- 54:7082c373d764
- Parent:
- 53:ee5e28819ebb
- Child:
- 59:61d308a0b113
diff -r ee5e28819ebb -r 7082c373d764 POKITTO_CORE/PokittoCore.cpp
--- a/POKITTO_CORE/PokittoCore.cpp Sat Jul 21 11:39:21 2018 +0000
+++ b/POKITTO_CORE/PokittoCore.cpp Sat Jul 21 12:33:25 2018 +0000
@@ -465,6 +465,7 @@
#define VINCMULT 50
#endif //POK_SIM
void Core::setVolLimit() {
+
display.enableDirectPrinting(true);
display.adjustCharStep = 0;
//sound.setMaxVol(VOLUME_HEADPHONE_MAX);
@@ -473,7 +474,6 @@
float vol = sound.getVolume(); float tvol;
#ifndef POK_SIM
vol=eeprom_read_byte((uint16_t*)EESETTINGS_VOL);
- if (vol<0) vol=0;
Pokitto::Sound::globalVolume=vol;
#endif
if (vol>VOLUME_HEADPHONE_MAX) sound.setMaxVol(VOLUME_SPEAKER_MAX);
@@ -482,14 +482,17 @@
vol=170;
sound.setMaxVol(VOLUME_SPEAKER_MAX);
#endif
- for (uint8_t t=0;t<=vol;t++) {
- sound.setVolume(t);
- }
+ //sound.setVolume(0);
+ //if (vol) {
+ //for (uint8_t t=0;t<=vol;t++) sound.setVolume(t);
+ //}
+ discrete_vol = ((int)vol>>5); //get rid of 0 vol number
+ sound.setVolume(vol);
volbar_visible=0;
int countd=0;
#ifndef POK_SIM
//read countdown time from settings
- countd = eeprom_read_byte((uint16_t*)EESETTINGS_VOLWAIT);
+ //countd = eeprom_read_byte((uint16_t*)EESETTINGS_VOLWAIT);
#endif
if (countd<=0 || countd > 10) countd=0xFFFF;
#ifdef PRODUCTIONTESTING