clear IsShiftedUp/Down at end of switch case, allow turning off with either shift

This commit is contained in:
Jeff Wang 2020-09-13 01:19:22 -04:00
parent 2b915a3e59
commit d8d7f98663
2 changed files with 1 additions and 5 deletions

View File

@ -105,7 +105,6 @@ void process_cmd(char cmd){
StackPtr--;
}
copy_decn(&stack(STACK_X), &LastX);
IsShiftedUp = 0;
} else { // +
do_binary_op(add_decn);
}
@ -118,10 +117,8 @@ void process_cmd(char cmd){
case '-':{
if (IsShiftedUp) {
do_unary_op(to_radian_decn);
IsShiftedUp = 0;
} else if (IsShiftedDown) {
do_unary_op(to_degree_decn);
IsShiftedDown = 0;
} else {
negate_decn(&stack(STACK_X));
do_binary_op(add_decn);
@ -165,7 +162,6 @@ void process_cmd(char cmd){
//////////
case '<':{ //use as +/- and sqrt
if (IsShiftedUp){ //take sqrt
IsShiftedUp = 0;
do_unary_op(sqrt_decn);
} else { // +/-
if (!decn_is_nan(&stack(STACK_X))){

View File

@ -307,7 +307,7 @@ int main()
switch(KEY_MAP[I_Key]){
//////////
case '0': {
if (IsShiftedUp){
if (IsShiftedUp || IsShiftedDown){
//off
TURN_OFF();
} else {