changeset 571:b24d42baa30d

BIG_SMALL_SLEEP mode implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 12 Jan 2019 23:03:06 +0000
parents 855b3c5bb4b5
children 074e24776948
files src/cs/layer1/cfile/l1_pwmgr.c src/cs/layer1/cfile/l1_small.c src/cs/layer1/include/l1_const.h src/cs/services/cst/cst_exts.c
diffstat 4 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/layer1/cfile/l1_pwmgr.c	Sat Jan 12 22:53:46 2019 +0000
+++ b/src/cs/layer1/cfile/l1_pwmgr.c	Sat Jan 12 23:03:06 2019 +0000
@@ -955,10 +955,12 @@
              why_big_sleep = BIG_SLEEP_DUE_TO_DSP_TRACES;
          }
       }
-      if (l1s.pw_mgr.mode_authorized == BIG_SLEEP)
+      if (l1s.pw_mgr.mode_authorized == BIG_SLEEP ||
+          l1s.pw_mgr.mode_authorized == BIG_SMALL_SLEEP)
         why_big_sleep = BIG_SLEEP_DUE_TO_SLEEP_MODE;
 
       if ( ((l1s.pw_mgr.mode_authorized == BIG_SLEEP) && (sleep_mode >= FRAME_STOP)) ||
+           ((l1s.pw_mgr.mode_authorized == BIG_SMALL_SLEEP) && (sleep_mode >= FRAME_STOP)) ||
            ((l1s.pw_mgr.mode_authorized >= DEEP_SLEEP) && (sleep_mode == FRAME_STOP)) )
         l1s.pw_mgr.sleep_performed = FRAME_STOP;
 
--- a/src/cs/layer1/cfile/l1_small.c	Sat Jan 12 22:53:46 2019 +0000
+++ b/src/cs/layer1/cfile/l1_small.c	Sat Jan 12 23:03:06 2019 +0000
@@ -231,9 +231,10 @@
  */
 asm("           .def    _switch_PWR_MNGT  ");
 asm("           .def    _mode_authorized  ");
-asm("SMALL_SLEEP         .equ     01h ");       
-asm("ALL_SLEEP           .equ     04h ");   
-asm("PWR_MNGT            .equ     01h "); 
+asm("SMALL_SLEEP         .equ     01h ");
+asm("ALL_SLEEP           .equ     04h ");
+asm("BIG_SMALL_SLEEP     .equ     05h ");
+asm("PWR_MNGT            .equ     01h ");
 #if (OP_L1_STANDALONE == 0)
    // This code log the number of time the Small sleep 
    // function has been invoked
@@ -267,6 +268,8 @@
 asm("	cmp	r1,#SMALL_SLEEP  ");    // take the current value of the register
 asm("	beq	Small_sleep_ok  ");
 asm("	cmp	r1,#ALL_SLEEP  ");      // take the current value of the register
+asm("	beq	Small_sleep_ok  ");
+asm("	cmp	r1,#BIG_SMALL_SLEEP  ");
 asm("	bne	End_small_sleep  ");
 
 asm("Small_sleep_ok    ");
--- a/src/cs/layer1/include/l1_const.h	Sat Jan 12 22:53:46 2019 +0000
+++ b/src/cs/layer1/include/l1_const.h	Sat Jan 12 23:03:06 2019 +0000
@@ -65,6 +65,7 @@
 #define BIG_SLEEP             02   // ------ +   BIG  + ------
 #define DEEP_SLEEP            03   // ------ +   BIG  +  DEEP
 #define ALL_SLEEP             04   // SMALL  +   BIG  +  DEEP
+#define BIG_SMALL_SLEEP       05   // SMALL  +   BIG  + ------
 
 // GAUGING SAMPLES
 #define SIZE_HIST             10
--- a/src/cs/services/cst/cst_exts.c	Sat Jan 12 22:53:46 2019 +0000
+++ b/src/cs/services/cst/cst_exts.c	Sat Jan 12 23:03:06 2019 +0000
@@ -650,9 +650,10 @@
              *     2 -> BIG_SLEEP
              *     3 -> DEEP_SLEEP
              *     4 -> ALL_SLEEP
+             *     5 -> BIG_SMALL_SLEEP
              */
 
-	    if (((*cmd - '0') >= 0) && ((*cmd - '0') <= 4))
+	    if (((*cmd - '0') >= 0) && ((*cmd - '0') <= 5))
             {
               power_down_config ((UBYTE) (*cmd - '0'), UWIRE_CLK_CUT);
 	      return( AT_CMPL );