Xmas Beta cannot take in custom GPIO pin mapping as additional parameters when loading module mk_arcade_joystick_rpi.ko.
-
I built a recalbox portable console with Pi 0 W; 2.2" il9341 TFT LCD with SPI using GPIO 9,10,11,25 supported by the adafruit drivers and GPIO controllers ( mk_arcade_joystick_rpi.ko) and the PWM 2 channel audio output using GPIO 18, 13. As the LCD and Audio GPIO overlaps with the default GPIO pins map parameters of
mk_arcade_joystick_rpi.ko module. i.e. "map=1" or "map =3", I have to create a custom pin mapping using the parameter of "map=4 gpio=21,24,26,19,5,6,22,4,20,17,27,16,12" to avoid the conflicts of pins used by the joystick buttons , LCD and audio output.
I found that the boot up script file (/recalbox/scripts/recalbox-config.sh) cannot take in the second parameter I put into the recalbox.conf file:
controllers.gpio.enabled=1
controllers.gpio.arg=map=4 gpio=21,24,26,19,5,6,22,4,20,17,27,16,12To fix the issue, please help to consider the following in the new release.
add the following lines to the top of the /recalbox/scripts/recalbox-config.sh. file to take in one additional parameter as $extra3.
extra3=$5Change the line in the section for GPIO controllers
from
map="$extra2"
to
map="$extra2 $extra3"Once the above is done, I can happily make my recalbox console works with TFT LCD; GPIO buttons soldered onto my circuit board, and stereo analog audio output driven by PWM through GPIO pin 13 and 18 and Ground.
Here are the parameters I used in the config files to make this work. With the modification I mentioned about for the recalbox-config.sh to take in one extra parameter for GPIO controllers.
mount -o remount, rw /boot
vi /boot/config.txt
add this to the end of the /boot/config.txt file to enable GPIO TFT
hdmi_group=2
hdmi_mode=87
hdmi_cvt=320 240 60 1 0 0 0
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft22,rotate=270,speed=64000000,fps=30also need to edit recalbox.conf to set system.fbcp.enabled=1 and global.videomode=default
#add this to end of the /boot/config.txt file to enable GPIOs analog audio
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4# edit recalbox.conf to enable fbp and TFT LCD and GPIO controllers
mount -o remount, rw /
cd ~
vi recalbox.confchange the following parameters as follows
#Tips for using vi: use “/word” to search for the word.
then press ENTER to jump to the first match.
then press "a" to add or modify. ESC to stop and “:x!” to savesystem.fbcp.enabled=1
global.videomode=defaultsystem.power.switch=PIN56PUSH
controllers.gpio.enabled=1
controllers.gpio.arg=map=4 gpio=21,24,26,19,5,6,22,4,20,17,27,16,12 -
@cheungbx
Note: the last two lines in the recalbox.conf appeared as two lines on this forum but is actually one single line.