diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-06-01 14:41:49 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-06-01 14:41:49 +0000 |
commit | b58d3656d79e5f9752a22d55c139294412084e4f (patch) | |
tree | bd98c9d2ab0db1e0df432814bb398cdb49739fe1 /apps/misc.c | |
parent | c54f4b34400ea96bd3e2d86ba919a0ae509a56a9 (diff) | |
download | rockbox-b58d3656d79e5f9752a22d55c139294412084e4f.tar.gz rockbox-b58d3656d79e5f9752a22d55c139294412084e4f.zip |
FS#11925 - Add a proper system to keep track of the current screen/activity to make %cs far more useful
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29944 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/misc.c')
-rw-r--r-- | apps/misc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index b027215ccc..5a99db2d8b 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -1021,3 +1021,20 @@ int clamp_value_wrap(int value, int max, int min) | |||
1021 | } | 1021 | } |
1022 | #endif | 1022 | #endif |
1023 | #endif | 1023 | #endif |
1024 | #define MAX_ACTIVITY_DEPTH 12 | ||
1025 | static enum current_activity | ||
1026 | current_activity[MAX_ACTIVITY_DEPTH] = {ACTIVITY_UNKNOWN}; | ||
1027 | static int current_activity_top = 0; | ||
1028 | void push_current_activity(enum current_activity screen) | ||
1029 | { | ||
1030 | current_activity[current_activity_top++] = screen; | ||
1031 | } | ||
1032 | void pop_current_activity(void) | ||
1033 | { | ||
1034 | current_activity_top--; | ||
1035 | } | ||
1036 | enum current_activity get_current_activity(void) | ||
1037 | { | ||
1038 | return current_activity[current_activity_top?current_activity_top-1:0]; | ||
1039 | } | ||
1040 | |||