diff src/cs/drivers/drv_app/spi/spi_process.c @ 260:34b7059b9337

drv_app/spi/*: code readability fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 14 May 2021 02:13:47 +0000
parents 365833d1d186
children
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/spi/spi_process.c	Fri May 14 01:30:13 2021 +0000
+++ b/src/cs/drivers/drv_app/spi/spi_process.c	Fri May 14 02:13:47 2021 +0000
@@ -3,7 +3,7 @@
 /*  Name       spi_process.c                                                 */
 /*                                                                           */
 /*  Function    this file contains the spi_process function, used to         */
-/*				handle messages received in the SPI mailbox, and used to 	 */
+/*		handle messages received in the SPI mailbox, and used to     */
 /*              access the ABB. It is called by the spi task core.           */
 /*                                                                           */
 /*  Version    0.1                                                           */
@@ -24,11 +24,6 @@
 #include "rv/rv_defined_swe.h"	   // for RVM_PWR_SWE
 
 
-
-//#ifndef _WINDOWS
-//#include "iq.h"
-//#endif
-
 /*******************************************************************************
 ** Function         spi_process
 **
@@ -36,53 +31,29 @@
 UINT8 spi_process(T_RV_HDR * msg_ptr)
 {
    UINT16 data ;
-//   static UINT8 int_nb = 0;
 
    if(msg_ptr != NULL)
    {
       switch (msg_ptr->msg_id)
       {
          case ABB_EXT_IRQ_EVT:
-		 {
+	 {
             /* Call to the low-level driver function : interrupt status register reading */
             data = ABB_Read_Register_on_page(PAGE0, ITSTATREG);
 
-//#ifndef _WINDOWS
-            // SW workaround to avoid an ABB interrupt occuring to early after the application start.
-			// The first ABB interrupt is skipped.
-
-//            if((int_nb == 0) && (data == ADCEND_IT_STS))
-//            {
-//              int_nb++;
-
-              /* Unmask keypad interrupt */
-//              IQ_Unmask(IQ_EXT);
-//            }
-//            else
-//            {
-
-			/* Callback function */
-//            if(msg_ptr->callback_func != NULL)
-//            {
-//               msg_ptr->callback_func(&data);
-//            }
-//          }
-//#else
-
             /* Callback function */
             if(msg_ptr->callback_func != NULL)
             {
                msg_ptr->callback_func(&data);
             }
-//#endif
 
             rvf_free_buf ((void *) msg_ptr);
 
-		   break;
-		 }
+	    break;
+	 }
 
          case SPI_ABB_READ_EVT:
-		 {
+	 {
            rvf_send_trace("SPI_task: SPI_READ_ABB_EVT received", 35, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID);
 
            /* Call to the low-level driver function */
@@ -97,10 +68,10 @@
            rvf_free_buf ((void *) msg_ptr);
 
            return 0;
-		 }
+	 }
 
          case SPI_ABB_WRITE_EVT:
-		 {
+	 {
            rvf_send_trace("SPI_task: SPI_WRITE_ABB_EVT received", 36, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID);
 
            /* Call to the low-level driver function */
@@ -109,10 +80,10 @@
            rvf_free_buf ((void *) msg_ptr);
 
            return 0;
-		 }
+	 }
 
          case SPI_ABB_CONF_ADC_EVT:
-		 {
+	 {
            rvf_send_trace("SPI_task: SPI_ABB_CONF_ADC_EVT received", 39, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID);
 
            /* Call to the low-level driver function */
@@ -121,10 +92,10 @@
            rvf_free_buf ((void *) msg_ptr);
 
            return 0;
-		 }
+	 }
 
          case SPI_ABB_READ_ADC_EVT:
-		 {
+	 {
            rvf_send_trace("SPI_task: SPI_ABB_READ_ADC_EVT received", 39, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_LOW, SPI_USE_ID);
 
            /* Call to the low-level driver function */
@@ -139,10 +110,10 @@
            rvf_free_buf ((void *) msg_ptr);
 
            return 0;
-		 }
+	 }
 
          default:
-		 {
+	 {
            /* Unknown message has been received */
            #ifdef RVM_PWR_SWE
            rvf_send_trace("SPI_task : Received an unknown or a PWR message",47, NULL_PARAM ,
@@ -155,10 +126,8 @@
            #endif
 
            return 1;
-		 }
+	 }
       }	   // end of switch
    }	// end of if (msg_ptr != NULL)
    return 0;
 }
-
-