C examples: move mraa_init() calls out of C examples and into C drivers.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2016-09-28 17:33:57 -06:00
parent c3a5b8dd3c
commit e7c80217c2
68 changed files with 274 additions and 256 deletions

View File

@ -29,6 +29,14 @@
bh1750_context bh1750_init(int bus, uint8_t addr, BH1750_OPMODES_T mode)
{
// make sure MRAA is initialized
int mraa_rv;
if ((mraa_rv = mraa_init()) != MRAA_SUCCESS)
{
printf("%s: mraa_init() failed (%d).\n", __FUNCTION__, mraa_rv);
return NULL;
}
bh1750_context dev =
(bh1750_context)malloc(sizeof(struct _bh1750_context));