Skip to content

Add --verify-loaded option. - #69

Open
aka-mj wants to merge 1 commit into
atmel-maxtouch:masterfrom
aka-mj:feature/add-verify-loaded-option
Open

Add --verify-loaded option.#69
aka-mj wants to merge 1 commit into
atmel-maxtouch:masterfrom
aka-mj:feature/add-verify-loaded-option

Conversation

@aka-mj

@aka-mj aka-mj commented Feb 5, 2019

Copy link
Copy Markdown

Prints out CRC from configuration file and the CRC from loaded configuration
in NVRAM. Will return exit code of 0 if they match or an exit
code of 1 if they do not.

# mxt-app --verify-loaded /lib/firmware/maxtouch.xcfg -v 1
CRC from config file  : 0x35B5CF
CRC from NVRAM        : 0x35B5CF
# echo $?
0
# mxt-app --verify-loaded /lib/firmware/Rev03.xcfg -v 1
CRC from config file  : 0x772DE2
CRC from NVRAM        : 0x35B5CF
CRC's do not match, configuration is not loaded
# echo $?
1

Prints out CRC from configuration file and the CRC from configuration
loaded in NVRAM. Will return exit code of 0 if they match or an exit
code of 1 if they do not.
@mgong98

mgong98 commented Mar 11, 2019

Copy link
Copy Markdown
Collaborator

There are 3 warnings to resolve on compile and 1 change made before code can be merged. 1 warning causes a segmentation fault. Please also update to latest code in master branch before doing new pull request.

Following changes are needed:

Warning #1:
src/mxt-app/mxt_app.c:937:22: warning: implicit declaration of function ‘mxt_get_config_crc’ [-Wimplicit-function-declaration]
uint32_t nvcrc = mxt_get_config_crc(mxt);

Add:
#include "libmaxtouch/msg.h" to include files at top of mxt_app.c file

Warning #2:
src/mxt-app/menu.c:262:5: warning: implicit declaration of function ‘mxt_print_config_crc’ [-Wimplicit-function-declaration]
mxt_print_config_crc(mxt);

Add:
void mxt_print_config_crc(struct mxt_device *mxt); to msg.h file
#include "libmaxtouch/msg.h" to include files at top of menu.c file

Correct:
ret = mxt_checkcrc(ctx, mxt, strbuf, cfcrc); to ret = mxt_checkcrc(ctx, mxt, strbuf, &cfcrc);

Initialize the nvcrc under main in mxt-app.c file
uint32_t nvcrc = 0;

Change to:
nvcrc = mxt_get_config_crc(mxt); in mxt-app.c file

@mgong98

mgong98 commented Mar 12, 2019

Copy link
Copy Markdown
Collaborator

Ignore this one. Fixed in latest branch to be merged.
Add:
void mxt_print_config_crc(struct mxt_device *mxt); to msg.h file
#include "libmaxtouch/msg.h" to include files at top of menu.c file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants