BPI-WiringPi now supports BPI-M2.Please go with the latest M2-BSP kernel source code.
(you may go to http://forum.banana-pi.org/t/m2-bpi-m2-bsp-updates/353 for more info)
You may download from github.
This is a modified WiringPi for BPI M1 / M1Plus /M2. We call it BPI-WiringPi. It is based on the original WiringPi for Raspberry Pi created by Drogon. The modification is done by BPI-Team. The BPI-WiringPi API usage are the same to the original wiringPi. You can donwload the original wiringPi from: git clone https://github.com/BPI-SINOVOIP/BPI-WiringPi.
Download For BPI-M2
git clone https://github.com/BPI-SINOVOIP/BPI-WiringPi.git -b BPI_M2
chmod +x ./build
You can go to folder ""m2_test" to test sample codes.