Taking care of review comments

This commit is contained in:
Joshua Jeyaraj
2018-11-05 13:23:37 +05:30
parent 299f05ec94
commit 8e95b8f9d6
11 changed files with 50 additions and 51 deletions

View File

@@ -10,10 +10,10 @@
#ifndef COMMON_INC_OCMP_WRAPPERS_OCMP_FLASH_H_
#define COMMON_INC_OCMP_WRAPPERS_OCMP_FLASH_H_
#define PAYLOAD_SIZE 47
#define FRAME_SIZE 64
#define LAST_MSG_FLAG 0
#define NEXT_MSG_FLAG_POS 17
#define NEXT_MSG_FLAG 1
#define LAST_MSG_FLAG 0
#define PAYLOAD_SIZE 47
#endif /* COMMON_INC_OCMP_WRAPPERS_OCMP_FLASH_H_ */

View File

@@ -13,11 +13,11 @@
SCHEMA_IMPORT bool SYS_post_get_results(void **getpostResult);
SCHEMA_IMPORT bool SYS_post_enable(void **postActivate);
SCHEMA_IMPORT const Driver_fxnTable AT45DB641E_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_sid_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_inv_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_sdr_inv_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_fe_inv_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable AT45DB641E_fxnTable;
static const Driver CAT24C04_gbc_sid = {
.name = "EEPROM",

View File

@@ -274,7 +274,7 @@ const Component sys_schema[] = {
{}
},
.driver_cfg = &gbc_spi_flash_memory,
.ssHookSet = &(SSHookSet){
.ssHookSet = &(SSHookSet) {
.postInitFxn = (ssHook_Cb)sys_post_init,
},
},

View File

@@ -46,9 +46,9 @@ extern "C" {
#define Board_initEMAC OC_CONNECT1_initEMAC
#define Board_initGeneral OC_CONNECT1_initGeneral
#define Board_initSPI OC_CONNECT1_initSPI
#define Board_initGPIO OC_CONNECT1_initGPIO
#define Board_initI2C OC_CONNECT1_initI2C
#define Board_initSPI OC_CONNECT1_initSPI
#define Board_initUART OC_CONNECT1_initUART
#define Board_initUSB OC_CONNECT1_initUSB
#define Board_initWatchdog OC_CONNECT1_initWatchdog

View File

@@ -18,23 +18,22 @@
#include "inc/common/global_header.h"
#include "inc/global/OC_CONNECT1.h"
#define AT45DB_MANFACTURE_ID 0x1F
#define AT45DB_DEVICE_ID 0x0028
#define AT45DB_READY 0x80 /* AT45DB Ready Value */
#define AT45DB_STATUS_OPCODE 0xD7
#define AT45DB_PAGE_ERASE_OPCODE 0x81
#define AT45DB_PAGE_RD_OPCODE 0xD2
#define AT45DB_SRAM_BUFF2_WR_OPCODE 0x87
#define AT45DB_PAGE_WR_OPCODE 0x86
#define AT45DB_DEVID_RD_OPCODE 0x9F
#define AT45DB_STATUS_OPCODE_WR_COUNT 1
#define AT45DB_DEVID_OPCODE_WR_COUNT 1
#define AT45DB_ERASE_OPCODE_WR_COUNT 4
#define AT45DB_DATA_WR_OPCODE_WR_COUNT 4
#define AT45DB_DATA_RD_OPCODE_WR_COUNT 8
#define AT45DB_STATUS_RD_BYTES 1
#define AT45DB_DEVICE_ID 0x0028
#define AT45DB_DEVID_RD_BYTES 2
#define AT45DB_DEVID_RD_OPCODE 0x9F
#define AT45DB_DEVID_OPCODE_WR_COUNT 1
#define AT45DB_ERASE_OPCODE_WR_COUNT 4
#define AT45DB_MANFACTURE_ID 0x1F
#define AT45DB_PAGE_ERASE_OPCODE 0x81
#define AT45DB_PAGE_RD_OPCODE 0xD2
#define AT45DB_PAGE_WR_OPCODE 0x86
#define AT45DB_READY 0x80 /* AT45DB Ready Value */
#define AT45DB_SRAM_BUFF2_WR_OPCODE 0x87
#define AT45DB_STATUS_OPCODE 0xD7
#define AT45DB_STATUS_OPCODE_WR_COUNT 1
#define AT45DB_STATUS_RD_BYTES 1
#define waitForReady(dev) \
while (!(AT45DB_READY & at45db_readStatusRegister(dev)));
@@ -216,7 +215,7 @@ ReturnStatus at45db_data_write(AT45DB_Dev *dev, uint8_t *data, uint32_t data_siz
status = AT45DB_write_reg(dev, &txBuffer, data, byte, data_size, AT45DB_DATA_WR_OPCODE_WR_COUNT);
if(status == RETURN_OK){
if(status == RETURN_OK) {
waitForReady(dev);
txBuffer[0] = AT45DB_PAGE_WR_OPCODE; /* opcode to Push the data from AT45DB SRAM Buffer2 to the page */

View File

@@ -18,13 +18,13 @@
#include "drivers/OcGpio.h"
#include "inc/common/spibus.h"
#include "inc/global/OC_CONNECT1.h"
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/sysbios/gates/GateMutex.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/drivers/GPIO.h>
#include <ti/drivers/SPI.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/gates/GateMutex.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Task.h>
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>

View File

@@ -15,29 +15,29 @@
#include "Board.h"
#include "common/inc/global/Framework.h"
#include "common/inc/global/ocmp_frame.h"
#include "inc/utils/util.h"
#include "inc/global/OC_CONNECT1.h"
#include "inc/common/bigbrother.h"
#include "inc/common/global_header.h"
#include "inc/devices/at45db.h"
#include "inc/common/bigbrother.h"
#include "inc/global/OC_CONNECT1.h"
#include "inc/utils/util.h"
#include "src/filesystem/fs_wrapper.h"
#include "src/filesystem/lfs.h"
#include <string.h>
#include <stdlib.h>
#include "src/filesystem/lfs.h"
#include <ti/drivers/GPIO.h>
#include <ti/drivers/SPI.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/drivers/GPIO.h>
#include <ti/drivers/SPI.h>
#define FRAME_SIZE 64
#define READ_SIZE 256
#define WRITE_SIZE 256
#define PAGE_SIZE 256
#define BLOCK_SIZE 256
#define BLOCK_COUNT 32768
#define FRAME_SIZE 64
#define LOOK_AHEAD 256
#define PAGE_SIZE 256
#define READ_SIZE 256
#define WRITE_SIZE 256
static Queue_Struct fsRxMsg;
static Queue_Struct fsTxMsg;
@@ -60,7 +60,7 @@ lfs_file_t file;
int block_device_read(const struct lfs_config *cfg, lfs_block_t block,
lfs_off_t off, void *buffer, lfs_size_t size)
{
if(at45db_data_read(cfg->context, buffer, size, off, block) != RETURN_OK){
if(at45db_data_read(cfg->context, buffer, size, off, block) != RETURN_OK) {
return LFS_ERR_IO;
}
@@ -101,7 +101,7 @@ int block_device_write(const struct lfs_config *cfg, lfs_block_t block,
*****************************************************************************/
int block_device_erase(const struct lfs_config *cfg, lfs_block_t block)
{
if(at45db_erasePage(cfg->context, block) != RETURN_OK){
if(at45db_erasePage(cfg->context, block) != RETURN_OK) {
return LFS_ERR_IO;
}
@@ -120,7 +120,7 @@ int block_device_erase(const struct lfs_config *cfg, lfs_block_t block)
*****************************************************************************/
int block_device_sync(const struct lfs_config *cfg)
{
if(at45db_readStatusRegister(cfg->context) != RETURN_OK){
if(at45db_readStatusRegister(cfg->context) != RETURN_OK) {
return LFS_ERR_IO;
}
@@ -141,7 +141,7 @@ int fileSize(const char *path)
{
uint32_t fileSize = 0;
if(lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) == LFS_ERR_OK){
if(lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) == LFS_ERR_OK) {
LOGGER_DEBUG("FS:: File open successfully \n");
}
fileSize = lfs_file_size(&lfs, &file);
@@ -168,7 +168,7 @@ bool fileWrite(const char *path, uint8_t *pMsg, uint32_t size )
if(lfs_file_write(&lfs, &file, pMsg, size) == size) {
LOGGER_DEBUG("FS:: File written successfully \n");
}
if(lfs_file_close(&lfs, &file) == LFS_ERR_OK){
if(lfs_file_close(&lfs, &file) == LFS_ERR_OK) {
LOGGER_DEBUG("FS:: File closed successfully \n");
}
@@ -246,12 +246,12 @@ void fs_init(UArg arg0, UArg arg1)
};
int err = lfs_mount(&lfs, &cfg);
if (err){
if (err) {
lfs_format(&lfs, &cfg);
lfs_mount(&lfs, &cfg);
}
if(!err){
if(!err) {
LOGGER_DEBUG("FS:: Filesystem mounted successfully \n");
}

View File

@@ -13,9 +13,9 @@
#include "common/inc/global/post_frame.h"
extern Semaphore_Handle semFilesysMsg;
extern Queue_Handle fsRxMsgQueue;
extern Queue_Handle fsTxMsgQueue;
extern Semaphore_Handle semFilesysMsg;
int fileSize(const char *path);
void fs_init(UArg arg0, UArg arg1);

View File

@@ -8,8 +8,8 @@
#ifndef LFS_H
#define LFS_H
#include <stdint.h>
#include <stdbool.h>
#include <stdint.h>
/* Type definitions */
typedef uint32_t lfs_size_t;

View File

@@ -60,9 +60,9 @@ int main(void)
openCellular_init();
/* Call board init functions */
Board_initGeneral();
Board_initSPI();
Board_initGPIO();
Board_initI2C();
Board_initSPI();
Board_initUSB(Board_USBDEVICE);
Board_initUART();
ethernet_start();

View File

@@ -8,17 +8,17 @@
*/
#include "common/inc/global/Framework.h"
#include <driverlib/flash.h>
#include <driverlib/sysctl.h>
#include "helpers/memory.h"
#include "inc/subsystem/sys/sys.h"
#include "inc/common/bigbrother.h"
#include "inc/common/global_header.h"
#include "inc/common/post.h"
#include "inc/devices/eeprom.h"
#include "inc/subsystem/gpp/gpp.h" /* For resetting AP */
#include "inc/common/bigbrother.h"
#include "inc/common/global_header.h"
#include "inc/subsystem/sys/sys.h"
#include "inc/utils/ocmp_util.h"
#include "src/filesystem/fs_wrapper.h"
#include <driverlib/flash.h>
#include <driverlib/sysctl.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Queue.h>
@@ -27,9 +27,9 @@
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#define FRAME_SIZE 64
#define OCFS_TASK_PRIORITY 5
#define OCFS_TASK_STACK_SIZE 4096
#define FRAME_SIZE 64
Task_Struct ocFSTask;
Char ocFSTaskStack[OCFS_TASK_STACK_SIZE];