Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Front/Front.cpp
- Revision:
- 26:a6033830d01c
- Parent:
- 25:f230af268e8b
- Child:
- 27:da783f414f67
diff -r f230af268e8b -r a6033830d01c Front/Front.cpp
--- a/Front/Front.cpp	Sun May 24 17:10:27 2020 +0000
+++ b/Front/Front.cpp	Sun May 24 17:27:42 2020 +0000
@@ -222,6 +222,10 @@
                 if (used==4) {
                     r=incrament_adsr(used,r,1);
                 }
+                if (used==5) {
+                    filter_type=incrament_adsr(used,filter_type,-1);
+                    printf("FILTER_TYPE=%d\n",filter_type);
+                    }
             }
 
             if (dir==5) {
@@ -237,10 +241,14 @@
                 if (used==4) {
                     r=incrament_adsr(used,r,-1);
                 }
+                if (used==5) {
+                filter_type=incrament_adsr(used,filter_type,1);
+                printf("FILTER_TYPE=%d\n",filter_type);
+                }
             }
             frontsetup(lcd,pad,submenu,filter_type,false);
             printsliders(lcd,a,d,s,r,used);
-            wait_ms(50);
+            wait_ms(80);
         } //END if DIR
         if ( pad.A_pressed())  { //NOTE ON
             printf("NOTE_ON\n");
@@ -283,7 +291,7 @@
     printfader(lcd,39,3);
     lcd.drawRect(50,3,30,8,FILL_TRANSPARENT);
     printwav(lcd,submenu);
-    printfilter(lcd, 3);
+    printfilter(lcd, filter_type);
     lcd.refresh();
 }
 
@@ -334,7 +342,7 @@
         printslider(lcd,15,d,false);
         printslider(lcd,27,s,false);
         printslider(lcd,39,r,false);
-        }
+    }
     lcd.refresh();
 }
 
@@ -413,6 +421,26 @@
             }
         }
     }
+    if (used==5) {
+        adsr=incrament_filter(adsr,ud);
+    }
+    return(adsr);
+}
+
+int Front::incrament_filter(int adsr, int ud)
+{
+    if (ud==1) {
+        adsr++;
+        if (adsr>3) {
+            adsr--;
+        }
+    }
+    if (ud==-1) {
+        adsr--;
+        if (adsr<0) {
+            adsr++;
+        }
+    }
     return(adsr);
 }