An I/O controller for virtual pinball machines: accelerometer nudge sensing, analog plunger input, button input encoding, LedWiz compatible output controls, and more.
Dependencies: mbed FastIO FastPWM USBDevice
Fork of Pinscape_Controller by
SimpleDMA_common.cpp
00001 #include "SimpleDMA.h" 00002 00003 void SimpleDMA::channel(int chan) { 00004 if (chan == -1) { 00005 auto_channel = true; 00006 _channel = 0; 00007 } else { 00008 auto_channel = false; 00009 if (chan >= 0 && chan < DMA_CHANNELS) 00010 _channel = chan; 00011 else 00012 _channel = DMA_CHANNELS-1; 00013 } 00014 } 00015 00016 int SimpleDMA::getFreeChannel(void) { 00017 int retval = 0; 00018 while(1) { 00019 if (!isBusy(retval)) 00020 return retval; 00021 retval++; 00022 if (retval >= DMA_CHANNELS) 00023 retval = 0; 00024 } 00025 }
Generated on Wed Jul 13 2022 03:30:11 by 1.7.2