Commit graph

39 commits

Author SHA1 Message Date
Daniele Rogora
bcf4f5c249 Workaround for reliable incoming calls waking up from CRUST
Replaced system() call with writefile()

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2020-12-05 11:58:31 +01:00
Maarten van Gompel
7fb7cd70f3 various indentation fixes (spaces to tabs and stripping trailing whitespace) 2020-11-20 18:10:17 +01:00
Miles Alan
8abe870012 Make suspendtimeout for screenlock cutomizable via SXMO_SUSPENDTIMEOUTS
This way if someone wants a longer or shorter timeout that possible
by setting the env var SXMO_SUSPENDTIMEOUTS.

Also change the default to be 35s. This is roughly the duration of
ringing for an incoming phone call.
2020-11-20 17:27:37 +01:00
Anjandev Momi
a0c6e4c2e2 enable bluetooth and modem drivers during crust suspend
With the megi 5.9 kernel and other suspend-related merge requests in
postmarketos, disabling these drivers is no longer needed. All of this
should result in a more reliable suspending system.

Source: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1651
Signed-off-by: Miles Alan <m@milesalan.com>
2020-11-07 08:28:27 -06:00
Miles Alan
acf21efba8 Fix wakeup from CRUST for incoming call for 5.9 kernel 2020-11-07 08:05:50 -06:00
Maarten van Gompel
6448587eb8 complete revision of gestures, using new edge system
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2020-10-31 13:53:46 +01:00
Maarten van Gompel
1b45e7743d added SXMO_LOCK_SCREEN_OFF and SXMO_LOCK_SUSPEND environment variables to set a target stage from the environment
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2020-10-31 12:16:06 +01:00
Maarten van Gompel
642bf1cc27 Implementing optional rtc wakeup at regular intervals, added presuspend, rtcwake and postwake scripts (with hooks)
(includes missing return 0 statement caught by Serge Hallyn)

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2020-10-31 12:13:22 +01:00
Anjandev Momi
55887d9afe update megiaudioroute.c for 5.9 kernel
When combined with Sam's audio patch, this fixes audio calls on 5.9
kernel.

Source: https://xnux.eu/devices/feature/audio-pp.html
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2020-10-28 23:57:33 -04:00
Serge E. Hallyn
5a4ce877df screenlock: set max field width for sprintf
Stop a compiler warning about overwriting the 100 char buffer with larger
string.

programs/sxmo_screenlock.c:61:3: note: ‘sprintf’ output between 39 and 294 bytes into a destination of size 100
2020-09-15 19:28:47 -05:00
Serge E. Hallyn
2cec0fc3be Enable irq wakeups
This is needed for crust to wake us up on an incoming call.

Thanks to smaeul in #crust for the tip.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2020-09-15 19:28:14 -05:00
Miles Alan
45c571727c Cleanup logic for notification LED setting; increase default call volume 2020-08-22 16:16:26 -05:00
Julian P Samaroo
a24d966b7e Fix = to == in screenlock 2020-07-30 18:39:14 -05:00
Maarten van Gompel
113f756eb1 Adding a wrapper around sxmo_screenlock, with lock/unlock hooks. Allow setting a target state for sxmo_screenlock, and cleanup on sigterm. Added lock/suspend options to the power menu.
Should be applied after my prior patches from today.
2020-07-26 10:31:57 -05:00
Miles Alan
f3275b7cd7 After exiting suspend blink LED while in temporary suspend pending state 2020-07-21 21:40:56 -05:00
Miles Alan
92e048a153 Screenlock: Recognize keyrelease rather than keydown to avoid inadvertent exits
E.g. so now you distinctively have to press down the powerbutton three times
rather than holding (which is easy to do inadvertently in pocket) to exit
screenlock.
2020-07-15 21:47:50 -05:00
Miles Alan
d713b19199 Use sxmo_statusbarupdate.sh script instead of direct calls duplicated logic 2020-07-12 11:38:31 -05:00
Miles Alan
10705f08cd Update statusbar on waking up from deep sleep so battery % & time accurate 2020-07-12 11:32:04 -05:00
Miles Alan
383c52380f 5s timeout for StateSuspendPending 2020-07-11 09:53:15 -05:00
Miles Alan
a35ca3f39f screenlock - Sort functions alphabetically; add declarations; and fix warnings 2020-07-09 21:17:11 -05:00
Miles Alan
b51644baca screenlock - Implement StateSuspendPending so exiting CRUST requires 3 clicks
If you don't triple click after exiting deep sleep after 10s, use select() with
timeout to kick back into deep sleep.
2020-07-09 20:51:50 -05:00
Anjandev Momi
a245f46914 screenlock: enable rtc wakeup source
Please apply to the crust feature branch. The rtc wakeup clock is useful cause it allows
users to script programs. If I put my phone into deep sleep, none of the scripts
I put in my cronjob will run.

For example, if I have an alarm script:

https://git.sr.ht/~anjan/sxmo-userscripts/tree/master/alarm.sh

It is supposed to run at 7:00 am but since I put my phone in deep sleep before going to sleep,
the script doesnt play sound to wake me up.

Enabling the rtc wakeup clock enables using programs like rtcwake as a wrapper around
your cronjobs to wake up the phone at a time and excecute the command you put in cron.

For info on how to use rtcwake, see:
https://wiki.postmarketos.org/wiki/Nokia_N900_(nokia-n900)#Setting_the_hardware_alarm_clock

Not sure if we should patch busybox cron to use rtcwake automatically or whether we should
trust the user to use rtcwake properly and document it. However, I am certain that the rtc
wakeup source should be enabled for this usecase.

Signed-off-by: Miles Alan <m@milesalan.com>
2020-07-09 20:51:30 -05:00
Miles Alan
cf4cd1b8df Retain brightness when entering screenlock 2020-07-09 20:51:30 -05:00
Miles Alan
7b3be0453a Disable buggy bluetooth driver before entering suspend 2020-07-09 20:51:30 -05:00
Miles Alan
aa8513ba84 Use direct open/write/close instead of stdlib calls for device IO 2020-07-09 20:51:30 -05:00
Miles Alan
37941f6ba8 Always reconfigure wakeup sources before entering suspend 2020-07-09 20:51:30 -05:00
Miles Alan
be6737e68f Always wake up from suspend to StateNoInput 2020-07-09 20:51:30 -05:00
Miles Alan
4d9d1ec45d Modify screenlock to suspend on triple pressing volume down button
Led indicators as follows:
  Blue: Screenlocked
  Purple: Screenlocked and Screenoff
  Red: CRUST suspend
2020-07-09 20:51:30 -05:00
Miles Alan
fb44e88552 Support headphone (linejack) mic input in audio routing program 2020-06-09 22:09:27 -05:00
Miles Alan
4c39cd16b0 Add missing option for echomic -z to megi's audioroute program 2020-06-09 18:57:30 -05:00
Miles Alan
660506b1e3 Set LED for screenlock before grabbing focus (e.g. register on PP button hold immediately) 2020-06-08 22:32:57 -05:00
Miles Alan
1ac5e64193 Tab indent C programs for consistency 2020-06-08 22:30:23 -05:00
Miles Alan
41714c8c96 Attempt to fix screenlock - only show led after screen is already locked 2020-06-07 10:05:46 -05:00
Miles Alan
b37138c845 Fix pine indicator leds paths for latest pmOS setup and add white (flash) 2020-05-17 18:59:43 -05:00
Miles Alan
e5877059ff Lots of bugfixes related to calling/modem and various script fixes 2020-05-11 20:55:47 -05:00
Miles Alan
22d974f22f Cleanup calling - mostly working; misc cleanup scripts; add vibrate program 2020-05-11 20:54:54 -05:00
Miles Alan
ae983ef8c8 Various progess on calling & texting; reorganize scripts dirs by category 2020-04-25 07:55:22 -05:00
Miles Alan
ed09f2b8b3 New scripts: sxmo_{youtube,weather,rss,camera}.sh; Implement screenlock
Various minor script bugfixes
2020-04-03 21:08:10 -05:00
Miles Alan
8ae9fbdb1c Initial commit 2020-03-15 18:42:35 -05:00