i have a small 25keys keyboard here (alesis proton x25), i managed to get the keys velocity sensitive to working, the connector is 1:1 to the DIO-Matrix —lucky me!
but i run into the problem that the code uses:
#define MIOS32\_DONT\_SERVICE\_SRIO\_SCAN 1
which disables my normal Shiftregisters for Encoder I cant use the J10 or J5 for it, because they have to less pins, and they are already used for other stuff anyway…
How can i use the Shiftregistors? … i have 4 DIN and 4 DOUT Registor in addition to the MB-DIO-Matrix
I read that in for example the MB-KB code:
///////////////////////////////////////////////////////////////////////////// // This hook is called after the shift register chain has been scanned ///////////////////////////////////////////////////////////////////////////// void APP\_SRIO\_ServiceFinish(void) { // -\> keyboard handler KEYBOARD\_SRIO\_ServiceFinish(); // standard SRIO scan has been disabled in programming\_models/traditional/main.c via MIOS32\_DONT\_SERVICE\_SRIO\_SCAN in mios32\_config.h // start the scan here - and retrigger it whenever it's finished APP\_SRIO\_ServicePrepare(); MIOS32\_SRIO\_ScanStart(APP\_SRIO\_ServiceFinish); }
i dont know what that mean? should it still working then?
i found out, that i still can activate LEDs, and i get the DIN-States, however i dont get any ENC Values
The Hardware itself is functional since i debugged it with tutorials/015_enc_absolute
i am pretty sure that something in here, break the enc routin e:
void APP\_SRIO\_ServicePrepare(void){ // select next column, wrap at 16 if( ++selected\_row \>= MATRIX\_NUM\_ROWS ) { selected\_row = 0; // increment timestamp for velocity delay measurements ++timestamp; } // selection pattern (active selection is 0, all other outputs 1) u16 selection\_mask = ~(1 \<\< (u16)selected\_row); // transfer to DOUTs #if MATRIX\_DOUT\_SR1 MIOS32\_DOUT\_SRSet(MATRIX\_DOUT\_SR1-1, (selection\_mask \>\> 0) & 0xff); #endif #if MATRIX\_DOUT\_SR2 MIOS32\_DOUT\_SRSet(MATRIX\_DOUT\_SR2-1, (selection\_mask \>\> 8) & 0xff); #endif} } void APP\_SRIO\_ServiceFinish(void) { // check DINs #if MATRIX\_DIN\_SR // the DIN scan was done with previous row selection, not the current one: int prev\_row = selected\_row ? (selected\_row - 1) : (MATRIX\_NUM\_ROWS - 1); u8 sr = MATRIX\_DIN\_SR; MIOS32\_DIN\_SRChangedGetAndClear(sr-1, 0xff); // ensure that change won't be propagated to normal DIN handler u8 sr\_value = MIOS32\_DIN\_SRGet(sr-1); // determine pin changes u8 changed = sr\_value ^ din\_value[prev\_row]; if( changed ) { // add them to existing notifications din\_value\_changed[prev\_row] |= changed; // store new value din\_value[prev\_row] = sr\_value; // store timestamp for changed pin on 1-\>0 transition u8 sr\_pin; u8 mask = 0x01; for(sr\_pin=0; sr\_pin\<8; ++sr\_pin, mask \<\<= 1) { if( (changed & mask) && !(sr\_value & mask) ) { din\_activated\_timestamp[prev\_row\*8 + sr\_pin] = timestamp; } } } #endif // standard SRIO scan has been disabled in programming\_models/traditional/main.c via MIOS32\_DONT\_SERVICE\_SRIO\_SCAN in mios32\_config.h // start the scan here - and retrigger it whenever it's finished APP\_SRIO\_ServicePrepare(); MIOS32\_SRIO\_ScanStart(APP\_SRIO\_ServiceFinish); }


