Changes per code review

This commit is contained in:
Jack Marriott
2018-12-05 16:10:37 -05:00
parent 8dbfc550a7
commit abebd529b4
13 changed files with 60 additions and 26 deletions

View File

@@ -34,7 +34,8 @@ ReturnStatus spi_reg_read(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
uint32_t byte, uint8_t numofBytes);
ReturnStatus spi_reg_write(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
void *regAddress, const uint8_t *data, uint32_t data_size,
uint32_t byte, uint8_t numofBytes);
void *regAddress, const uint8_t *data,
uint32_t data_size, uint32_t byte,
uint8_t numofBytes);
#endif /* INC_COMMON_SPIBUS_H_ */

View File

@@ -37,12 +37,10 @@ OCMPMessageFrame *OCMP_mallocFrame(uint16_t len);
** RETURN TYPE : OCMPMessageFrame
**
*****************************************************************************/
OCMPMessageFrame *create_ocmp_msg_frame(OCMPSubsystem subSystem,
OCMPMsgType msgtype,
OCMPActionType actionType,
uint8_t componentId,
uint16_t parameters,
uint8_t payloadSize);
OCMPMessageFrame *
create_ocmp_msg_frame(OCMPSubsystem subSystem, OCMPMsgType msgtype,
OCMPActionType actionType, uint8_t componentId,
uint16_t parameters, uint8_t payloadSize);
/*****************************************************************************
** FUNCTION NAME : create_ocmp_alert_from_Evt

View File

@@ -83,8 +83,9 @@ static ReturnStatus AT45DB_read_reg(AT45DB_Dev *dev,
*****************************************************************************/
static ReturnStatus AT45DB_write_reg(AT45DB_Dev *dev,
void *cmdbuffer, /* cmd or opcode buffer */
const uint8_t *regValue, uint32_t pageOffset,
uint32_t NumOfbytes, uint8_t writeCount)
const uint8_t *regValue,
uint32_t pageOffset, uint32_t NumOfbytes,
uint8_t writeCount)
{
ReturnStatus status = RETURN_NOTOK;
SPI_Handle at45dbHandle = spi_get_handle(dev->cfg.dev.bus);

View File

@@ -102,6 +102,9 @@ uint16_t get_interrupt_status(uint8_t port)
* Internal IRQ handler - reads in triggered interrupts and dispatches CBs
*****************************************************************************/
#if 0
/* NOTE: Commented out because unused, triggers -Wunused-function warning.
* The function might be useful in the future.
*/
static void _ethernet_sw_isr(void *context)
{
Eth_cfg *ethCfg = context;

View File

@@ -188,6 +188,9 @@ static ePostCode _probe(void *driver, POSTData *postData)
}
#if 0
/* NOTE: Commented out because unused, triggers -Wunused-function warning.
* The function might be useful in the future.
*/
static void _alert_handler(Eth_Sw_Events evt, int16_t value, void *alert_data)
{
unsigned int alert;

View File

@@ -72,7 +72,8 @@ bool static _get_config(void *driver, unsigned int param_id, void *return_buf)
return ret;
}
bool static _set_config(void *driver, unsigned int param_id, const void *return_buf)
bool static _set_config(void *driver, unsigned int param_id,
const void *return_buf)
{
bool ret = false;
FE_Ch_Band_cfg *driverCfg = driver;

View File

@@ -26,18 +26,24 @@ static bool _get_status(void *driver, unsigned int param_id, void *return_buf)
return ret;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
static ePostCode _probe(void *driver, POSTData *postData)
{
pwr_source_config(driver);
return POST_DEV_NOSTATUS;
}
#pragma GCC diagnostic pop
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
static ePostCode _init(void *driver, const void *config,
const void *alert_token)
{
pwr_source_init();
return POST_DEV_NO_CFG_REQ;
}
#pragma GCC diagnostic pop
const Driver_fxnTable PWRSRC_fxnTable = {
/* Message handlers */

View File

@@ -198,8 +198,10 @@ bool sbd9603_get_regStatus(OBC_Iridium_Status_Data *pIridiumStatusData)
}
#if 0
#include "helpers/memory.h"
# include "helpers/memory.h"
/* NOTE: Commented out because unused, triggers -Wunused-function warning.
* The function might be useful in the future.
*/
static void loopback_test(SBD_Handle hSbd, bool debugLogs)
{
static int loopCount = 1;

View File

@@ -121,8 +121,9 @@ ReturnStatus spi_reg_read(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
**
*****************************************************************************/
ReturnStatus spi_reg_write(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
void *regAddress, const uint8_t *data, uint32_t data_size,
uint32_t byte, uint8_t numofBytes)
void *regAddress, const uint8_t *data,
uint32_t data_size, uint32_t byte,
uint8_t numofBytes)
{
ReturnStatus status = RETURN_OK;
SPI_Transaction spiTransaction;

View File

@@ -41,18 +41,14 @@ static UART_Handle UartMon_open(UART_Handle handle, UART_Params *params)
return NULL;
}
#if 0
/* This is a driver limitation - we only support blocking mode for now */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wenum-compare"
if (params->readDataMode != UART_MODE_BLOCKING ||
params->writeDataMode != UART_MODE_BLOCKING) {
#pragma GCC diagnostic pop
return NULL;
}
#else
/* Logically the same as above, but unsure if OK with TI UART Driver */
if (params->readDataMode || params->writeDataMode) {
return NULL;
}
#endif
obj->hUart_in = UART_open(cfg->uart_in_idx, params);
if (!obj->hUart_in) {

View File

@@ -123,10 +123,12 @@ Void tcpHandler_client(UArg arg0, UArg arg1)
struct sockaddr_in sLocalAddr;
/*Tiva operates at 120Mhz. We use delays based on this*/
uint32_t g_ui32SysClock = 120000000;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
#pragma GCC diagnostic ignored "-Wint-conversion"
fdOpenSession(TaskSelf());
lSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
#pragma GCC diagnostic pop
if (lSocket < 0) {
LOGGER_DEBUG("tcpHandler: socket failed\n");
Task_exit();
@@ -138,11 +140,16 @@ Void tcpHandler_client(UArg arg0, UArg arg1)
memset((char *)&sLocalAddr, 0, sizeof(sLocalAddr));
LOGGER_DEBUG(" Ip in client: %s\n", destIp);
sLocalAddr.sin_family = AF_INET;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
sLocalAddr.sin_addr.s_addr = inet_addr(destIp);
#pragma GCC diagnostic pop
sLocalAddr.sin_port = htons(arg0);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wint-conversion"
while (connect(lSocket, (struct sockaddr *)&sLocalAddr,
sizeof(sLocalAddr)) < 0) {
#pragma GCC diagnostic pop
SysCtlDelay(g_ui32SysClock / 100 / 3);
}
System_flush();
@@ -151,14 +158,20 @@ Void tcpHandler_client(UArg arg0, UArg arg1)
int nbytes = 14; /* Test Pattern length */
while (numRepeat > 0) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wint-conversion"
send(lSocket, (char *)buffer, nbytes, 0);
#pragma GCC diagnostic pop
Task_sleep(500);
numRepeat--;
System_flush();
}
if (lSocket > 0)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wint-conversion"
close(lSocket);
fdCloseSession(TaskSelf());
#pragma GCC diagnostic pop
}
/*
@@ -283,7 +296,10 @@ int ethernet_start(void)
/*
* Configure necessary things for MDC/MDIO
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
prepare_mdio();
#pragma GCC diagnostic pop
return (0);
}

View File

@@ -193,6 +193,9 @@ static void post_move_to_next_subsystem()
**
*****************************************************************************/
#if 0
/* NOTE: Commented out because unused, triggers -Wunused-function warning.
* The function might be useful in the future.
*/
static void post_update_result_to_bigbrother(OCMPMessageFrame *pPOSTMsg)
{
pPOSTMsg->message.subsystem = OC_SS_SYS; // OC_SUBSYSTEM_MAX_LIMIT subsystem
@@ -263,6 +266,9 @@ static OCMPMessageFrame *post_create_execute_msg(OCMPSubsystem OC_subSystem)
**
*****************************************************************************/
#if 0
/* NOTE: Commented out because unused, triggers -Wunused-function warning.
* The function might be useful in the future.
*/
static OCMPMessageFrame *post_create_enable_msg(OCMPSubsystem OC_subSystem)
{
uint8_t dummyByte = 0xff;

View File

@@ -56,7 +56,7 @@ void post_update_POSTData(POSTData *pData, uint8_t I2CBus, uint8_t devAddress,
extern void post_update_POSTStatus(POSTData *pData, ePostCode status);
extern void post_init_POSTData(POSTData *pData, OCMPSubsystem subsystem,
uint8_t devSno);
uint8_t devSno);
void post_update_POSTresult(POSTData *postData);
static uint8_t deviceCount = 0;