mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
ssd1327: 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
cb6427b22e
commit
7323b58b61
@ -22,6 +22,7 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
@ -42,7 +43,8 @@ SSD1327::SSD1327(int bus_in, int addr_in) : m_i2c_lcd_control(bus_in)
|
||||
|
||||
error = m_i2c_lcd_control.address(m_lcd_control_address);
|
||||
if (error != mraa::SUCCESS) {
|
||||
fprintf(stderr, "Failed to initialize i2c bus\n");
|
||||
throw std::invalid_argument(std::string(__FUNCTION__) +
|
||||
": I2c.address() failed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user