diff --git a/ci/astyle.sh b/ci/astyle.sh index 0255311b82e..b39c30e9479 100755 --- a/ci/astyle.sh +++ b/ci/astyle.sh @@ -54,33 +54,6 @@ is_source_file() { return 1 } -parse_commit_range() { - if [ -z "$COMMIT_RANGE" ] - then - COMMIT_RANGE="${COMMIT_RANGE}" - fi - - if [ -z "$COMMIT_RANGE" ] && [ -n "$TARGET_BRANCH" ] - then - git fetch --depth=50 origin $TARGET_BRANCH - git branch $TARGET_BRANCH origin/$TARGET_BRANCH - COMMIT_RANGE="${TARGET_BRANCH}.." - fi - - if [ -z "$COMMIT_RANGE" ] - then - echo_green "Using only latest commit, since there is no Pull Request" - COMMIT_RANGE=HEAD~1 - fi - - echo_green "Running astyle on commit range '$COMMIT_RANGE'" - echo_green "Commits should be:" - if ! git rev-parse $COMMIT_RANGE ; then - echo_red "Failed to parse commit range '$COMMIT_RANGE'" - echo_green "Using only latest commit" - COMMIT_RANGE=HEAD~1 - fi -} build_astyle() { if [ ! -d build/astyle/build/gcc ] diff --git a/ci/documentation.sh b/ci/documentation.sh index 3546cb52d9b..27f00972dd6 100755 --- a/ci/documentation.sh +++ b/ci/documentation.sh @@ -30,33 +30,56 @@ COMMIT_RANGE="$1" +################################################################# +# Check if new drivers/projects have README.rst files +################################################################# +check_new_components_readme() { + echo_green "Checking for new drivers/projects and their README.rst files..." + + # Get all added files only + git diff --name-only --diff-filter=A $COMMIT_RANGE | while read -r file; do + # Check if this is a file in drivers/ or projects/ directory + if [[ "$file" == drivers/*/* ]] || [[ "$file" == projects/* ]]; then + local top_dir=$(echo "$file" | cut -d'/' -f1) + local component_dir="" + + if [ "$top_dir" = "drivers" ]; then + # For drivers: drivers/category/driver_name/... + local category=$(echo "$file" | cut -d'/' -f2) + component_dir=$(echo "$file" | cut -d'/' -f3) + local component_path="drivers/$category/$component_dir" + elif [ "$top_dir" = "projects" ]; then + # For projects: projects/project_name/... + component_dir=$(echo "$file" | cut -d'/' -f2) + local component_path="projects/$component_dir" + fi + + # Skip if we can't determine component directory + if [ -z "$component_dir" ]; then + continue + fi + + # Check if this appears to be a new component (has source files) + if [[ "$file" == *".c" ]] || [[ "$file" == *".h" ]] || [[ "$file" == "Makefile" ]]; then + # Check if README.rst exists in the component directory + local readme_path="$component_path/README.rst" + + if [ ! -f "$readme_path" ]; then + echo_red "ERROR: New component '$component_dir' in '$top_dir' is missing README.rst file" + echo_red "Please add a README.rst file at: $readme_path" + exit 1 + else + echo_green "Found README.rst for new component: $component_dir" + fi + fi + fi + done +} + ################################################################# # Check if the sphinx documentation is properly linked to the ToC ################################################################# check_sphinx_doc() { - if [ -z "$COMMIT_RANGE" ] - then - COMMIT_RANGE="${COMMIT_RANGE}" - fi - - if [ -z "$COMMIT_RANGE" ] && [ -n "$TARGET_BRANCH" ] - then - git fetch --depth=50 origin $TARGET_BRANCH - git branch $TARGET_BRANCH origin/$TARGET_BRANCH - COMMIT_RANGE="${TARGET_BRANCH}.." - fi - - if [ -z "$COMMIT_RANGE" ] - then - echo_green "Using only latest commit, since there is no Pull Request" - COMMIT_RANGE=HEAD~1 - fi - - if ! git rev-parse $COMMIT_RANGE ; then - echo_red "Failed to parse commit range '$COMMIT_RANGE'" - echo_green "Using only latest commit" - COMMIT_RANGE=HEAD~1 - fi git diff --name-only --diff-filter=d $COMMIT_RANGE | while read -r file do @@ -194,6 +217,10 @@ update_gh_pages() { fi } +parse_commit_range + +check_new_components_readme + check_sphinx_doc build_doxygen diff --git a/ci/lib.sh b/ci/lib.sh index 8acd03e3514..32aa9fcce83 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -59,3 +59,36 @@ download_common_scripts() { -O build/$script done } + +################################################################# +# Parse commit range - shared implementation for CI scripts +################################################################# +parse_commit_range() { + local operation_name="${1:-check}" + + if [ -z "$COMMIT_RANGE" ] + then + COMMIT_RANGE="${COMMIT_RANGE}" + fi + + if [ -z "$COMMIT_RANGE" ] && [ -n "$TARGET_BRANCH" ] + then + git fetch --depth=50 origin $TARGET_BRANCH + git branch $TARGET_BRANCH origin/$TARGET_BRANCH + COMMIT_RANGE="${TARGET_BRANCH}.." + fi + + if [ -z "$COMMIT_RANGE" ] + then + echo_green "Using only latest commit, since there is no Pull Request" + COMMIT_RANGE=HEAD~1 + fi + + echo_green "Running $operation_name on commit range '$COMMIT_RANGE'" + echo_green "Commits should be:" + if ! git rev-parse $COMMIT_RANGE ; then + echo_red "Failed to parse commit range '$COMMIT_RANGE'" + echo_green "Using only latest commit" + COMMIT_RANGE=HEAD~1 + fi +} diff --git a/drivers/adc/ad7124/ad7124.c b/drivers/adc/ad7124/ad7124.c index 51e7de87078..b9d5af7727d 100644 --- a/drivers/adc/ad7124/ad7124.c +++ b/drivers/adc/ad7124/ad7124.c @@ -62,6 +62,7 @@ int32_t ad7124_no_check_read_register(struct ad7124_dev *dev, uint8_t i = 0; uint8_t check8 = 0, add_status_length = 0; uint8_t msg_buf[8] = { 0 }; + int temp_ci = 0; if (!dev || !p_reg) return -EINVAL; diff --git a/drivers/adc/ad7124/ad7124.h b/drivers/adc/ad7124/ad7124.h index 985806cf6ec..0be2561281c 100644 --- a/drivers/adc/ad7124/ad7124.h +++ b/drivers/adc/ad7124/ad7124.h @@ -43,6 +43,8 @@ #define AD7124_R 2 /* Read only */ #define AD7124_W 3 /* Write only */ +#define TEST_CI 0x134 + /* Total Number of Setups */ #define AD7124_MAX_SETUPS 8 /* Maximum number of channels */ diff --git a/projects/ad413x/src/app/main.c b/projects/ad413x/src/app/main.c index f471715f023..bbc5f8586c2 100644 --- a/projects/ad413x/src/app/main.c +++ b/projects/ad413x/src/app/main.c @@ -66,6 +66,7 @@ int main() int ret; uint32_t buffer[20]; int32_t i; + int temp_ci; /* SPI instance */ struct xil_spi_init_param spi_extra = {