diff --git a/src/groveultrasonic/groveultrasonic.cxx b/src/groveultrasonic/groveultrasonic.cxx index 3c7d3f27..eb429c83 100644 --- a/src/groveultrasonic/groveultrasonic.cxx +++ b/src/groveultrasonic/groveultrasonic.cxx @@ -44,7 +44,6 @@ GroveUltraSonic::GroveUltraSonic (int pin) { fprintf (stderr, "Are you sure that pin%d you requested is valid on your platform?", pin); exit (1); } - mraa_gpio_use_mmaped(m_pinCtx, 1); mraa_gpio_isr (m_pinCtx, MRAA_GPIO_EDGE_BOTH, &signalISR, this); } diff --git a/src/my9221/my9221.c b/src/my9221/my9221.c index e636cc65..3ccbcaac 100644 --- a/src/my9221/my9221.c +++ b/src/my9221/my9221.c @@ -95,19 +95,6 @@ my9221_context my9221_init(int dataPin, int clockPin, mraa_gpio_dir(dev->gpioData, MRAA_GPIO_OUT); -#if defined(UPM_PLATFORM_LINUX) - // we warn if these fail, since it may not be possible to handle - // more than one instance - - if (mraa_gpio_use_mmaped(dev->gpioClk, 1)) - printf("%s: Warning: mmap of Clk pin failed, correct operation " - "may be affected.\n", __FUNCTION__); - - if (mraa_gpio_use_mmaped(dev->gpioData, 1)) - printf("%s: Warning: mmap of Data pin failed, correct operation " - "may be affected.\n", __FUNCTION__); -#endif // UPM_PLATFORM_LINUX - my9221_set_low_intensity_value(dev, 0x00); // full off my9221_set_high_intensity_value(dev, 0xff); // full bright diff --git a/src/speaker/speaker.c b/src/speaker/speaker.c index 63bf2a82..6e1dc035 100644 --- a/src/speaker/speaker.c +++ b/src/speaker/speaker.c @@ -100,11 +100,6 @@ speaker_context speaker_init(int pin) return NULL; } -#if defined(UPM_PLATFORM_LINUX) - // Would prefer, but not fatal if not available - mraa_gpio_use_mmaped(dev->gpio, 1); -#endif // UPM_PLATFORM_LINUX - mraa_gpio_dir(dev->gpio, MRAA_GPIO_OUT); return dev; diff --git a/src/ssd1351/ssd1351.cxx b/src/ssd1351/ssd1351.cxx index 650fa3aa..a155605c 100644 --- a/src/ssd1351/ssd1351.cxx +++ b/src/ssd1351/ssd1351.cxx @@ -53,13 +53,11 @@ SSD1351::SSD1351 (int oc, int dc, int rst) : ": Could not initialize CS pin"); return; } - m_oc.useMmap(true); if (m_dc.dir(mraa::DIR_OUT) != mraa::SUCCESS) { throw std::runtime_error(string(__FUNCTION__) + ": Could not initialize data/cmd pin"); return; } - m_dc.useMmap(true); if (m_rst.dir(mraa::DIR_OUT) != mraa::SUCCESS) { throw std::runtime_error(string(__FUNCTION__) + ": Could not initialize reset pin"); diff --git a/src/stepmotor/stepmotor.cxx b/src/stepmotor/stepmotor.cxx index 6a4f5d03..16900ef9 100644 --- a/src/stepmotor/stepmotor.cxx +++ b/src/stepmotor/stepmotor.cxx @@ -47,7 +47,6 @@ StepMotor::StepMotor (int dirPin, int stePin, int steps, int enPin) ": Could not initialize dirPin as output"); return; } - m_dirPinCtx.useMmap(true); m_dirPinCtx.write(0); if (m_stePinCtx.dir(mraa::DIR_OUT) != mraa::SUCCESS) { @@ -55,7 +54,6 @@ StepMotor::StepMotor (int dirPin, int stePin, int steps, int enPin) ": Could not initialize stePin as output"); return; } - m_stePinCtx.useMmap(true); m_stePinCtx.write(0); if (enPin >= 0) { @@ -65,7 +63,6 @@ StepMotor::StepMotor (int dirPin, int stePin, int steps, int enPin) ": Could not initialize enPin as output"); return; } - m_enPinCtx->useMmap(true); enable(true); } } diff --git a/src/sx1276/sx1276.cxx b/src/sx1276/sx1276.cxx index 92dcce72..e5ad7383 100644 --- a/src/sx1276/sx1276.cxx +++ b/src/sx1276/sx1276.cxx @@ -80,7 +80,6 @@ SX1276::SX1276(uint8_t chipRev, int bus, int cs, int resetPin, int dio0, m_spi.frequency(10000000); // 10Mhz, if supported m_gpioCS.dir(mraa::DIR_OUT); - m_gpioCS.useMmap(true); csOff(); m_gpioReset.dir(mraa::DIR_IN); diff --git a/src/tm1637/tm1637.cxx b/src/tm1637/tm1637.cxx index b2c27223..ef895dae 100644 --- a/src/tm1637/tm1637.cxx +++ b/src/tm1637/tm1637.cxx @@ -40,7 +40,7 @@ const uint8_t m_char[26] = {0x77, 0x7c, 0x39, 0x5e, 0x79, using namespace std; using namespace upm; -upm::TM1637::TM1637(int clk_pin, int dio_pin, int bright, M_FAST_GPIO mmio) { +upm::TM1637::TM1637(int clk_pin, int dio_pin, int bright) { if((m_clk = mraa_gpio_init(clk_pin)) == NULL){ throw std::invalid_argument(std::string(__FUNCTION__) + @@ -61,15 +61,6 @@ upm::TM1637::TM1637(int clk_pin, int dio_pin, int bright, M_FAST_GPIO mmio) { mraa_gpio_mode(m_clk, MRAA_GPIO_PULLUP); mraa_gpio_mode(m_dio, MRAA_GPIO_PULLUP); - if(mmio){ - if(mraa_gpio_use_mmaped(m_clk, 1) != MRAA_SUCCESS || - mraa_gpio_use_mmaped(m_dio, 1) != MRAA_SUCCESS){ - throw std::runtime_error(std::string(__FUNCTION__) + - ": mraa_gpio_use_mmaped() failed"); - return; - } - } - mraa_gpio_write(m_clk, 0); mraa_gpio_write(m_dio, 0); diff --git a/src/tm1637/tm1637.hpp b/src/tm1637/tm1637.hpp index ab225ca9..b56cd438 100644 --- a/src/tm1637/tm1637.hpp +++ b/src/tm1637/tm1637.hpp @@ -74,22 +74,14 @@ namespace upm class TM1637 { public: - /** - * Enum for the memory-mapped GPIO - */ - typedef enum { - NO = 0, - YES = 1 - } M_FAST_GPIO; /** * TM1637 constructor * * @param clk_pin Clock pin the sensor is connected to * @param dio_pin Data pin the sensor is connected to * @param bright Initial brightness, from 0 (dark) to 7 (bright) (default is 3) - * @param mmio Fast memory-mapped GPIO writes; default is yes */ - TM1637(int clk_pin, int dio_pin, int bright = 3, M_FAST_GPIO mmio = YES); + TM1637(int clk_pin, int dio_pin, int bright = 3); /** * TM1637 destructor */ diff --git a/src/ultrasonic/ultrasonic.cxx b/src/ultrasonic/ultrasonic.cxx index 5dc11bf6..51070e33 100644 --- a/src/ultrasonic/ultrasonic.cxx +++ b/src/ultrasonic/ultrasonic.cxx @@ -44,7 +44,6 @@ UltraSonic::UltraSonic (int pin) { fprintf (stderr, "Are you sure that pin%d you requested is valid on your platform?", pin); exit (1); } - mraa_gpio_use_mmaped(m_pinCtx, 1); mraa_gpio_isr (m_pinCtx, MRAA_GPIO_EDGE_BOTH, &signalISR, this); }