Controlls of IHM01A1 by Joystick shield

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Fork of X_NUCLEO_IHM01A1 by ST

Files at this revision

API Documentation at this revision

Comitter:
Davidroid
Date:
Tue Feb 28 16:12:31 2017 +0000
Parent:
31:c4d0fee5ce75
Child:
33:8daea0279301
Commit message:
Fitting mbed coding style.

Changed in this revision

Components/l6474/l6474_class.h Show annotated file Show diff for this revision Revisions of this file
X_NUCLEO_COMMON.lib Show annotated file Show diff for this revision Revisions of this file
--- a/Components/l6474/l6474_class.h	Fri Oct 28 13:31:51 2016 +0000
+++ b/Components/l6474/l6474_class.h	Tue Feb 28 16:12:31 2017 +0000
@@ -98,8 +98,9 @@
     L6474(PinName flag_irq, PinName standby_reset, PinName direction, PinName pwm, PinName ssel, DevSPI &spi) : StepperMotor(), flag_irq(flag_irq), standby_reset(standby_reset), direction(direction), pwm(pwm), ssel(ssel), dev_spi(spi)
     {
         /* Checking stackability. */
-        if (!(number_of_devices < MAX_NUMBER_OF_DEVICES))
+        if (!(number_of_devices < MAX_NUMBER_OF_DEVICES)) {
             error("Instantiation of the L6474 component failed: it can be stacked up to %d times.\r\n", MAX_NUMBER_OF_DEVICES);
+        }
 
         /* ACTION 4 ----------------------------------------------------------*
          * Initialize here the component's member variables, one variable per *
@@ -216,8 +217,7 @@
         unsigned int register_value = (unsigned int) L6474_CmdGetParam((L6474_Registers_t) parameter);
         float value;
 
-        switch ((L6474_Registers_t) parameter)
-        {
+        switch ((L6474_Registers_t) parameter) {
             case L6474_TVAL:
                 value = L6474_Par_to_Tval_Current((float) register_value);
                 break;
@@ -368,8 +368,7 @@
     {
         float register_value;
 
-        switch ((L6474_Registers_t) parameter)
-        {
+        switch ((L6474_Registers_t) parameter) {
             case L6474_TVAL:
                 register_value = L6474_Tval_Current_to_Par(value);
                 break;
@@ -590,8 +589,9 @@
      */
     virtual bool SetStepMode(step_mode_t step_mode)
     {
-        if ((motorStepMode_t) step_mode > STEP_MODE_1_16)
+        if ((motorStepMode_t) step_mode > STEP_MODE_1_16) {
             return false;
+        }
 
         SoftHiZ();
         L6474_SelectStepMode((motorStepMode_t) step_mode);
@@ -783,8 +783,9 @@
      */
     Status_t Read(uint8_t* pBuffer, uint16_t NumBytesToRead)
     {
-        if (dev_spi.spi_read(pBuffer, ssel, NumBytesToRead) != 0)
+        if (dev_spi.spi_read(pBuffer, ssel, NumBytesToRead) != 0) {
             return COMPONENT_ERROR;
+        }
         return COMPONENT_OK;
     }
     
@@ -796,8 +797,9 @@
      */
     Status_t Write(uint8_t* pBuffer, uint16_t NumBytesToWrite)
     {
-        if (dev_spi.spi_write(pBuffer, ssel, NumBytesToWrite) != 0)
+        if (dev_spi.spi_write(pBuffer, ssel, NumBytesToWrite) != 0) {
             return COMPONENT_ERROR;
+        }
         return COMPONENT_OK;
     }
 
@@ -810,8 +812,9 @@
      */
     Status_t ReadWrite(uint8_t* pBufferToRead, uint8_t* pBufferToWrite, uint16_t NumBytes)
     {
-        if (dev_spi.spi_read_write(pBufferToRead, pBufferToWrite, ssel, NumBytes) != 0)
+        if (dev_spi.spi_read_write(pBufferToRead, pBufferToWrite, ssel, NumBytes) != 0) {
             return COMPONENT_ERROR;
+        }
         return COMPONENT_OK;
     }
 
--- a/X_NUCLEO_COMMON.lib	Fri Oct 28 13:31:51 2016 +0000
+++ b/X_NUCLEO_COMMON.lib	Tue Feb 28 16:12:31 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/ST/code/X_NUCLEO_COMMON/#216930edb6b7
+http://developer.mbed.org/teams/ST/code/X_NUCLEO_COMMON/#12be3dfc15fd