Post Reply 
WP31s error recovery
03-02-2015, 05:43 PM
Post: #8
RE: WP31s error recovery
I noticed a while ago that there were multiple things wrong IMO with the undo function in the 31S but I haven't yet gotten around to dealing with it properly, or even figuring out whether or not the behavior matches the official documentation. This is something I'll definitely fix unless someone else does it first.

You may want to try the following patch but be warned, it hasn't yet received much testing.

Code:
diff -ur wp31s_r3756/keys.c wp31s_fix_undo_r3756_20150301/keys.c
--- wp31s_r3756/keys.c  2015-02-07 13:09:33.000000000 -0500
+++ wp31s_fix_undo_r3756_20150301/keys.c        2015-03-01 23:10:38.752104407 -0500
@@ -1964,6 +1964,7 @@
                        OpCode = 0;
 
                        if (c == (OP_NIL | OP_OFF) || !is_bad_cmdline()) {
+                               process_cmdline();
                                xcopy(&Undo2State, &UndoState, sizeof(TPersistentRam));
                                xcopy(&UndoState, &PersistentRam, sizeof(TPersistentRam));
                                xeq(c);
@@ -2028,19 +2029,27 @@
                        break;
 
                case STATE_UNDO:
-                       xcopy(&PersistentRam, &UndoState, sizeof(TPersistentRam));
+                       if (CmdLineLength)
+                               CmdLineLength = CmdLineEex = CmdLineDot = 0;
+                       else {
+                               xcopy(&PersistentRam, &UndoState, sizeof(TPersistentRam));
+//                             xcopy(&UndoState, &Undo2State, sizeof(TPersistentRam));
+                       }
                        break;
 
                default:
                        if (c >= (OP_SPEC | OP_ENTER) && c <= (OP_SPEC | OP_F)) {
                                if (c != (OP_SPEC | OP_ENTER) || !is_bad_cmdline()) {
                                        // Data entry key
-                                       xcopy(&Undo2State, &UndoState, sizeof(TPersistentRam));
-                                       xcopy(&UndoState, &PersistentRam, sizeof(TPersistentRam));
+                                       cmdline_empty = (CmdLineLength == 0);
+                                       if (c == (OP_SPEC | OP_ENTER) || (CmdLineLength == 0 && c == (OP_SPEC | OP_CLX))) {
+                                               process_cmdline();
+                                               xcopy(&Undo2State, &UndoState, sizeof(TPersistentRam));
+                                               xcopy(&UndoState, &PersistentRam, sizeof(TPersistentRam));
+                                       }
 #ifndef CONSOLE
                                        WasDataEntry = 1;
 #endif
-                                       cmdline_empty = (CmdLineLength == 0);
                                        xeq(c);
                                        cmdline_empty |= (CmdLineLength == 0);
                                }
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
WP31s error recovery - Dieter - 03-01-2015, 10:07 PM
RE: WP31s error recovery - BarryMead - 03-02-2015, 03:41 AM
RE: WP31s error recovery - Dieter - 03-02-2015, 06:42 AM
RE: WP31s error recovery - BarryMead - 03-02-2015, 07:57 AM
RE: WP31s error recovery - Dieter - 03-02-2015, 07:34 PM
RE: WP31s error recovery - BarryMead - 03-02-2015, 07:44 PM
RE: WP31s error recovery - Dieter - 03-03-2015, 07:10 AM
RE: WP31s error recovery - Bit - 03-03-2015, 01:54 PM
RE: WP31s error recovery - rprosperi - 03-03-2015, 01:58 PM
RE: WP31s error recovery - Bit - 03-04-2015, 12:56 AM
RE: WP31s error recovery - rprosperi - 03-04-2015, 02:48 AM
RE: WP31s error recovery - Dieter - 03-03-2015, 07:34 PM
RE: WP31s error recovery - BarryMead - 03-03-2015, 08:10 PM
RE: WP31s error recovery - Dieter - 03-03-2015, 08:48 PM
RE: WP31s error recovery - BarryMead - 03-03-2015, 08:57 PM
RE: WP31s error recovery - Dieter - 03-03-2015, 09:15 PM
RE: WP31s error recovery - Bit - 03-04-2015, 01:02 AM
RE: WP31s error recovery - Dieter - 03-04-2015, 01:30 PM
RE: WP31s error recovery - Bit - 03-05-2015, 04:15 AM
RE: WP31s error recovery - Paul Dale - 03-05-2015, 04:58 AM
RE: WP31s error recovery - Dieter - 03-05-2015, 08:25 PM
RE: WP31s error recovery - Bit - 03-02-2015 05:43 PM
RE: WP31s error recovery - Bit - 03-04-2015, 12:52 AM
RE: WP31s error recovery - BarryMead - 03-05-2015, 07:31 PM
RE: WP31s error recovery - Dieter - 03-05-2015, 08:04 PM
RE: WP31s error recovery - rprosperi - 03-05-2015, 08:13 PM
RE: WP31s error recovery - BarryMead - 03-05-2015, 08:29 PM
RE: WP31s error recovery - rprosperi - 03-05-2015, 09:39 PM
RE: WP31s error recovery - BarryMead - 03-05-2015, 09:51 PM
RE: WP31s error recovery - rprosperi - 03-05-2015, 10:44 PM
RE: WP31s error recovery - Dieter - 03-05-2015, 08:35 PM
RE: WP31s error recovery - BarryMead - 03-05-2015, 08:51 PM
RE: WP31s error recovery - Bit - 03-07-2015, 04:29 AM
RE: WP31s error recovery - rprosperi - 03-07-2015, 02:09 PM
RE: WP31s error recovery - walter b - 03-08-2015, 03:36 AM
RE: WP31s error recovery - Paul Dale - 03-07-2015, 10:36 PM
RE: WP31s error recovery - Bit - 03-15-2015, 04:31 PM
RE: WP31s error recovery - Paul Dale - 03-04-2015, 06:22 AM
RE: WP31s error recovery - Bit - 03-04-2015, 02:02 PM



User(s) browsing this thread: 1 Guest(s)