mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
ldt0028: 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
f29141087e
commit
a1db1b423b
@ -22,13 +22,21 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "ldt0028.h"
|
||||
|
||||
using namespace upm;
|
||||
|
||||
LDT0028::LDT0028(unsigned int pin) {
|
||||
// initialize analog input
|
||||
m_pin = mraa_aio_init(pin);
|
||||
if ( !(m_pin = mraa_aio_init(pin)) )
|
||||
{
|
||||
throw std::invalid_argument(std::string(__FUNCTION__) +
|
||||
": mraa_aio_init() failed, invalid pin?");
|
||||
return;
|
||||
}
|
||||
m_name = "ldt0-028";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user