-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scripts: add a script to fix gigadevice firmwares libs #19
base: main
Are you sure you want to change the base?
Conversation
scripts/lib_refactor/make_new_hal.sh
Outdated
@@ -0,0 +1,27 @@ | |||
#!/usr/bin/env fish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: we should be using a common shell, ie bash.
Hi @feilongfl, Did you have time to review our comments? |
fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure all needed fixes are applied, see 48a1b67
scripts/lib_refactor/README.md
Outdated
## Dependencies | ||
|
||
``` | ||
apt install fish | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need another shell to run refactor scripts?
scripts/lib_refactor/eval_patch.sh
Outdated
if [ $# -ne 2 ] | ||
then | ||
echo "arguments error" | ||
exit | ||
fi | ||
|
||
source_file=$2 | ||
cocci=$1 | ||
|
||
echo cocci: $cocci | ||
echo source: $source_file | ||
|
||
spatch -cocci_file $cocci $source_file | patch $source_file - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not run this line directly?
scripts/lib_refactor/make_new_hal.sh
Outdated
if [ $# -ne 1 ] | ||
then | ||
echo "arguments error" | ||
exit | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please provide better error messages
mkdir gd32c10x | ||
unrar x /tmp/gd32c10x.rar gd32c10x | ||
mv gd32c10x/*/* gd32c10x/ | ||
scripts/lib_refactor/make_new_hal.sh gd32c10x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib_refactor
isn't probably a good name if it adds scripts to add a new HAL. I think that we should just provide a script to add a HAL (or update, which means remove and add), such script should also run patch scripts under the hood.
In fact, all the steps above could be handled by the script itself (download, uncompress, copy/delete, patch).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a preliminary version and wanted to check if it meets your expectations.
Contains download, decompression, patch functions.
I'm not sure if it makes sense to remove hal.
Is this PR |
I think I need a little more time to implement the download and add/delete hal functions. |
7525b89
to
eec38d3
Compare
883b8e9
to
a1c65ef
Compare
gd32e10x: update HAL to v1.3.0 Signed-off-by: YuLong Yao <[email protected]>
apply fllowing patches for hal: - drop I2CCLK_MAX/I2CCLK_MIN - add `gd32_` prefix for timer_init - add ifdef to BIT macro - remove nvic_vector_table_set function call Signed-off-by: YuLong Yao <[email protected]>
link script readme to top readme Signed-off-by: YuLong Yao <[email protected]>
add script for auto import gigadevice hal Signed-off-by: YuLong Yao <[email protected]>
You need solve conflict due to #27 |
I learned the usage of
coccinelle
today and found that it is very suitable for migrate gigadevice libs tohal-gigadevice
.I think it will be very useful when add firmwares for new chip
GD32_
prefix forCAN_XXX_MODE
andCAN_TIMEOUT
marconvic_vector_table_set
function callBIT
marcotimer_init
togd32_timer_init
I2CCLK_MAX
,I2CCLK_MIN
,I2CCLK_FM_MIN
,I2CCLK_FM_PLUS_MIN
inxxxx_i2c.h
drop
I2CCLK_MAX
,I2CCLK_MIN
inxxxx_i2c.c