mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
gas: 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
48e6d4bcfa
commit
5f27c5515f
@ -27,13 +27,16 @@
|
||||
#include <stdlib.h>
|
||||
#include <functional>
|
||||
#include <string.h>
|
||||
#include <stdexcept>
|
||||
#include "gas.h"
|
||||
|
||||
using namespace upm;
|
||||
|
||||
Gas::Gas(int gasPin) {
|
||||
// initialise analog gas input
|
||||
m_gasCtx = mraa_aio_init(gasPin);
|
||||
if (!(m_gasCtx = mraa_aio_init(gasPin)))
|
||||
throw std::invalid_argument(std::string(__FUNCTION__) +
|
||||
": mraa_aio_init() failed, invalid pin?");
|
||||
}
|
||||
|
||||
Gas::~Gas() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user