Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions ci/astyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
73 changes: 50 additions & 23 deletions ci/documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -194,6 +217,10 @@ update_gh_pages() {
fi
}

parse_commit_range

check_new_components_readme

check_sphinx_doc

build_doxygen
Expand Down
33 changes: 33 additions & 0 deletions ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 1 addition & 0 deletions drivers/adc/ad7124/ad7124.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions drivers/adc/ad7124/ad7124.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions projects/ad413x/src/app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading