mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
isd1820: throw exception(s) on fatal errors
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
6a6eaa1b71
commit
0af62a6992
@ -23,6 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "isd1820.h"
|
#include "isd1820.h"
|
||||||
|
|
||||||
@ -33,7 +35,8 @@ ISD1820::ISD1820(int playPin, int recPin)
|
|||||||
{
|
{
|
||||||
if ( !(m_gpioPlay = mraa_gpio_init(playPin)) )
|
if ( !(m_gpioPlay = mraa_gpio_init(playPin)) )
|
||||||
{
|
{
|
||||||
cerr << __FUNCTION__ << ": mraa_gpio_init() failed" << endl;
|
throw std::invalid_argument(std::string(__FUNCTION__) +
|
||||||
|
": mraa_gpio_init(playPin) failed, invalid pin?");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +44,8 @@ ISD1820::ISD1820(int playPin, int recPin)
|
|||||||
|
|
||||||
if ( !(m_gpioRec = mraa_gpio_init(recPin)) )
|
if ( !(m_gpioRec = mraa_gpio_init(recPin)) )
|
||||||
{
|
{
|
||||||
cerr << __FUNCTION__ << ": mraa_gpio_init() failed" << endl;
|
throw std::invalid_argument(std::string(__FUNCTION__) +
|
||||||
|
": mraa_gpio_init(recPin) failed, invalid pin?");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user