Skip to content

Commit

Permalink
Merge pull request Sensirion#82 from Sensirion/migrate-to-github-work…
Browse files Browse the repository at this point in the history
…flow

Migrate to GitHub workflow
  • Loading branch information
psachs authored Apr 19, 2024
2 parents 76cb6e6 + ccacf49 commit 9496777
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 130 deletions.
93 changes: 0 additions & 93 deletions .circleci/config.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: syntax, static code analyis and build check for c drivers

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
code-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: cppcheck clang-format
version: 1.0
- name: clang-format syntax-check
run: |
find sht-common -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find shtc1 -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find sht3x -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find sht4x -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
git diff --exit-code
- name: cppcheck static code analyis
run: cppcheck --std=c89 --language=c --error-exitcode=1 --enable=warning,style,performance,portability --suppress=unreadVariable -i sample-projects/ -i embedded-common/ -i release/ .
34 changes: 0 additions & 34 deletions .gitlab-ci.yml

This file was deleted.

3 changes: 1 addition & 2 deletions sht3x/sht3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,12 @@ void sht3x_set_power_mode(sht3x_measurement_mode_t mode) {

int16_t sht3x_read_serial(sht3x_i2c_addr_t addr, uint32_t* serial) {
int16_t ret;
uint8_t serial_bytes[4];

ret = sensirion_i2c_write_cmd(addr, SHT3X_CMD_READ_SERIAL_ID);
sensirion_sleep_usec(SHT3X_CMD_DURATION_USEC);

if (ret == STATUS_OK) {

uint8_t serial_bytes[4];
ret = sensirion_i2c_read_words_as_bytes(
addr, serial_bytes, SENSIRION_NUM_WORDS(serial_bytes));
*serial = sensirion_bytes_to_uint32_t(serial_bytes);
Expand Down
2 changes: 1 addition & 1 deletion shtc1/shtc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int16_t shtc1_read_serial(uint32_t* serial) {
return ret;

*serial = ((uint32_t)serial_words[0] << 16) | serial_words[1];
return ret;
return 0;
}

const char* shtc1_get_driver_version(void) {
Expand Down

0 comments on commit 9496777

Please sign in to comment.