mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
lol: 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
7323b58b61
commit
77abd94682
@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <functional>
|
||||
@ -136,7 +138,15 @@ LoL::LoL() {
|
||||
int i = 0;
|
||||
mraa_result_t error;
|
||||
for (i = 0; i < 12; i++)
|
||||
m_LoLCtx[i] = mraa_gpio_init(i+2);
|
||||
{
|
||||
if ( !(m_LoLCtx[i] = mraa_gpio_init(i+2)) )
|
||||
{
|
||||
throw std::invalid_argument(std::string(__FUNCTION__) +
|
||||
": mraa_gpio_init() failed, invalid pin?");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
memset(framebuffer, 0, LOL_X*LOL_Y);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user