]> bicyclesonthemoon.info Git - klavirko/ui/commitdiff
further adjustment of AIX communication handling
authorb <rowerynaksiezycu@gmail.com>
Sat, 1 Feb 2025 09:01:44 +0000 (10:01 +0100)
committerb <rowerynaksiezycu@gmail.com>
Sat, 1 Feb 2025 09:01:44 +0000 (10:01 +0100)
aix.c
aix.h

diff --git a/aix.c b/aix.c
index 240b77c221a681ad798f82fe9277713b7e7015f0..bd44f644642c5e427774df50c4ec21224fd27882 100644 (file)
--- a/aix.c
+++ b/aix.c
@@ -182,9 +182,15 @@ void handle_aix (void)
                        else if (data >= 'a' && data <= 'f')
                                data -= 'a' - 10;
                        else if (data >= 'G' && data <= 'V')
+                       {
                                data -= 'G';
+                               aix_i = 0;
+                       }
                        else if (data >= 'g' && data <= 'v')
+                       {
                                data -= 'g';
+                               aix_i = 0;
+                       }
                        else
                                data = 0;
                        
@@ -199,7 +205,8 @@ void handle_aix (void)
                                aix_sel = data;
                                break;
                        case 1: // value bits 7-4
-                               aix_val = 0;
+                               aix_val = data;
+                               break;
                        case 2: // value bits 3-0
                                aix_val |= data;
                                break;
@@ -213,7 +220,8 @@ void handle_aix (void)
                                break;
                        }
                        
-                       ++aix_i; // next byte
+                       if (aix_i <= 7)
+                               ++aix_i; // next byte
                }
        }
 }
diff --git a/aix.h b/aix.h
index 9efe1eb9ac0e1e109cce3d50ac1df6859297c3b8..8f209e9358b03761fe9f2a4954480f8639dd12e9 100644 (file)
--- a/aix.h
+++ b/aix.h
@@ -81,7 +81,7 @@ UI layout:
        AIX_DATA_DEFAULT, AIX_DATA_DEFAULT, AIX_DATA_DEFAULT, AIX_DATA_DEFAULT, \
        AIX_DATA_DEFAULT \
 }
-#define N_AIX_BUFFER    10
+#define N_AIX_BUFFER    32
 #define AIX_MIN_DIFF    8
 #define AIX_TIMEOUT     1190
 #define AIX_SW_DEBOUNCE 60