FreeCalypso > hg > fc-selenite
comparison src/cs/services/cst/cst_exts.c @ 151:ea4af6f4104d
cst_exts.c: changes from Magnetite: allow BIG_SMALL_SLEEP
and formatting fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 06 Feb 2019 23:34:17 +0000 |
parents | b6a5e36de839 |
children |
comparison
equal
deleted
inserted
replaced
150:d43dadd91383 | 151:ea4af6f4104d |
---|---|
613 cmd++; | 613 cmd++; |
614 | 614 |
615 switch (*cmd) { | 615 switch (*cmd) { |
616 | 616 |
617 case 'e': | 617 case 'e': |
618 case 'E': | 618 case 'E': |
619 /* 's''e' already detected => assume the command is at%ser. */ | 619 /* 's''e' already detected => assume the command is at%ser. */ |
620 { | 620 { |
621 cmd += 3; /* Discard the following characters */ | 621 cmd += 3; /* Discard the following characters */ |
622 *cmdLen -= 9; | 622 *cmdLen -= 9; |
623 if (SER_WriteConfig (cmd, (BOOL) (*(cmd + 3) - '0'))) | 623 if (SER_WriteConfig (cmd, (BOOL) (*(cmd + 3) - '0'))) |
624 return( AT_CMPL ); | 624 return( AT_CMPL ); |
625 else | 625 else |
626 return( AT_FAIL ); | 626 return( AT_FAIL ); |
627 } | 627 } |
628 | 628 |
629 case 'w': | 629 case 'w': |
630 case 'W': | 630 case 'W': |
631 /* 's''w' already detected => assume the command is at%switch. */ | 631 /* 's''w' already detected => assume the command is at%switch. */ |
632 { | 632 { |
633 *cmdLen -= 7; | 633 *cmdLen -= 7; |
634 if (SER_ImmediateSwitch()) | 634 if (SER_ImmediateSwitch()) |
635 return( AT_CMPL ); | 635 return( AT_CMPL ); |
636 else | 636 else |
637 return( AT_FAIL ); | 637 return( AT_FAIL ); |
638 } | 638 } |
639 | 639 |
640 case 'l': | 640 case 'l': |
641 case 'L': | 641 case 'L': |
642 /* 's''l' already detected => assume the command is at%sleep. */ | 642 /* 's''l' already detected => assume the command is at%sleep. */ |
643 { | 643 { |
644 cmd += 5; /* Discard the following characters */ | 644 cmd += 5; /* Discard the following characters */ |
645 *cmdLen -= 8; | 645 *cmdLen -= 8; |
646 /* | 646 /* |
647 * Checks if the parameter is valid: | 647 * Checks if the parameter is valid: |
648 * 0 -> NO_SLEEP | 648 * 0 -> NO_SLEEP |
649 * 1 -> SMALL_SLEEP | 649 * 1 -> SMALL_SLEEP |
650 * 2 -> BIG_SLEEP | 650 * 2 -> BIG_SLEEP |
651 * 3 -> DEEP_SLEEP | 651 * 3 -> DEEP_SLEEP |
652 * 4 -> ALL_SLEEP | 652 * 4 -> ALL_SLEEP |
653 * 5 -> BIG_SMALL_SLEEP | |
653 */ | 654 */ |
654 | 655 |
655 if (((*cmd - '0') >= 0) && ((*cmd - '0') <= 4)) | 656 if (((*cmd - '0') >= 0) && ((*cmd - '0') <= 5)) |
656 { | 657 { |
657 power_down_config ((UBYTE) (*cmd - '0'), UWIRE_CLK_CUT); | 658 power_down_config ((UBYTE) (*cmd - '0'), UWIRE_CLK_CUT); |
658 return( AT_CMPL ); | 659 return( AT_CMPL ); |
659 } | 660 } |
660 else | 661 else |
661 return( AT_FAIL ); | 662 return( AT_FAIL ); |
662 } | 663 } |
663 | 664 |
664 default: | 665 default: |
665 *cmdLen -= 2; | 666 *cmdLen -= 2; |
666 return ( AT_FAIL ); | 667 return ( AT_FAIL ); |
667 | 668 |
668 } | 669 } |
669 } | 670 } |
670 | 671 |
671 case 'H': | 672 case 'H': |
672 *cmdLen -= 2; | 673 *cmdLen -= 2; |
673 | 674 |
737 { | 738 { |
738 //audio_test_misc(); | 739 //audio_test_misc(); |
739 out[0] = 22; | 740 out[0] = 22; |
740 memcpy (&out[1], "Performing Audio Tests", 22); | 741 memcpy (&out[1], "Performing Audio Tests", 22); |
741 out [23] = (CHAR) 0xff; | 742 out [23] = (CHAR) 0xff; |
742 } | 743 } |
743 else | 744 else |
744 { | 745 { |
745 if (!strncmp(cmd, "R", 1) || !strncmp(cmd, "r", 1)) | 746 if (!strncmp(cmd, "R", 1) || !strncmp(cmd, "r", 1)) |
746 { | 747 { |
747 //rtc_test_misc(); | 748 //rtc_test_misc(); |
749 memcpy (&out[1], "Performing RTC Tests", 20); | 750 memcpy (&out[1], "Performing RTC Tests", 20); |
750 out [21] = (CHAR) 0xff; | 751 out [21] = (CHAR) 0xff; |
751 } | 752 } |
752 else | 753 else |
753 return( AT_FAIL ); | 754 return( AT_FAIL ); |
754 } | 755 } |
755 return( AT_CMPL ); | 756 return( AT_CMPL ); |
756 #endif | 757 #endif |
757 default: | 758 default: |
758 *cmdLen -= 2; | 759 *cmdLen -= 2; |
759 return ( AT_FAIL ); | 760 return ( AT_FAIL ); |