Skip to content

Commit 26560f7

Browse files
committed
Accélération du démarrage du launcher sur le vrai hardware en autorisant l'update pendant la veille
1 parent b4ec96b commit 26560f7

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

lib/gsm/src/gsm.cpp

+14-13
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,7 @@ namespace GSM
270270
{
271271
return simLocked;
272272
}
273-
274-
bool setSimPin(const std::string &pin)
275-
{
276-
coresync.lock();
277-
std::string o = send("AT+CPIN=\"" + pin + "\"", "OK");
278-
279-
PaxOS_Delay(1000);
280-
281-
isSimLockedAsk();
282-
coresync.unlock();
283-
return isSimLocked();
284-
}
285-
273+
286274
void isSimLockedAsk()
287275
{
288276
std::string o = send("AT+CPIN?", "OK");
@@ -303,6 +291,19 @@ namespace GSM
303291
}
304292
}
305293

294+
bool setSimPin(const std::string &pin)
295+
{
296+
coresync.lock();
297+
std::string o = send("AT+CPIN=\"" + pin + "\"", "OK");
298+
299+
PaxOS_Delay(1000);
300+
301+
isSimLockedAsk();
302+
coresync.unlock();
303+
return isSimLocked();
304+
}
305+
306+
306307
void onRinging()
307308
{
308309
if (state.callState == CallState::RINGING)

lib/gsm/src/gsm.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ namespace GSM
130130

131131

132132
bool isSimLocked();
133-
bool setSimPin(const std::string &pin);
133+
bool setSimPin(const std::string &pin); // use the mutex!! so do not call from this core
134134

135135
// Network
136136
struct HttpHeader

src/main.cpp

+13-8
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ void mainLoop(void* data) {
7171
AppManager::loop();
7272
eventHandlerApp.update();
7373

74-
if(AppManager::isAnyVisibleApp() && launcher)
74+
if(AppManager::isAnyVisibleApp() && launcher) // free the launcher is an app is running and the launcher is active
7575
{
7676
applications::launcher::free();
7777
launcher = false;
7878
}
7979

80-
if(libsystem::getDeviceMode() == libsystem::NORMAL && !AppManager::isAnyVisibleApp())
80+
if(launcher)
81+
applications::launcher::update();
82+
83+
if(libsystem::getDeviceMode() == libsystem::NORMAL && !AppManager::isAnyVisibleApp()) // si mode normal et pas d'app en cours
8184
{
8285
if(!launcher) // si pas de launcher -> afficher un launcher
8386
{
@@ -86,8 +89,6 @@ void mainLoop(void* data) {
8689
}
8790
else // si launcher -> l'update et peut être lancer une app
8891
{
89-
applications::launcher::update();
90-
9192
if(applications::launcher::iconTouched())
9293
{
9394
// run the app
@@ -115,10 +116,14 @@ void mainLoop(void* data) {
115116
{
116117
setDeviceMode(libsystem::NORMAL);
117118
StandbyMode::disable();
119+
120+
#ifndef ESP_PLATFORM
121+
applications::launcher::draw();
122+
#endif
118123
} else if(launcher)
119124
{
120-
applications::launcher::free();
121-
launcher = false;
125+
//applications::launcher::free();
126+
//launcher = false;
122127
libsystem::setDeviceMode(libsystem::SLEEP);
123128
StandbyMode::enable();
124129
} else if(AppManager::isAnyVisibleApp())
@@ -137,8 +142,8 @@ void mainLoop(void* data) {
137142
{
138143
if(launcher)
139144
{
140-
applications::launcher::free();
141-
launcher = false;
145+
//applications::launcher::free();
146+
//launcher = false;
142147
}
143148
for (uint32_t i = 0; i < 10 && AppManager::isAnyVisibleApp(); i++) // define a limit on how many apps can be stopped (prevent from a loop)
144149
{

0 commit comments

Comments
 (0)