Browse Source

grovecircularled: fix up a missing mraa::DATA_OUT and formatting

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Jon Trulson 9 years ago
parent
commit
181b5f17ea
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      src/grovecircularled/grovecircularled.cxx

+ 10
- 5
src/grovecircularled/grovecircularled.cxx View File

@@ -36,18 +36,23 @@
36 36
 using namespace upm;
37 37
 
38 38
 GroveCircularLED::GroveCircularLED (uint8_t di, uint8_t dcki)
39
-									: m_clkPinCtx(dcki),
40
-									  m_dataPinCtx(di) {
39
+  : m_clkPinCtx(dcki),
40
+    m_dataPinCtx(di) 
41
+{
41 42
   mraa::Result error = mraa::SUCCESS;
42 43
   
43
-  m_clkPinCtx.useMmap(true);
44
-  m_dataPinCtx.useMmap(true);
45
-
46 44
   // set direction (out)
45
+  error = m_dataPinCtx.dir(mraa::DIR_OUT);
46
+  if (error != mraa::SUCCESS) {
47
+    printError(error);
48
+  }
47 49
   error = m_clkPinCtx.dir(mraa::DIR_OUT);
48 50
   if (error != mraa::SUCCESS) {
49 51
     printError(error);
50 52
   }
53
+
54
+  m_clkPinCtx.useMmap(true);
55
+  m_dataPinCtx.useMmap(true);
51 56
 }
52 57
 
53 58
 mraa::Result