diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a42d60b7c..94056c991 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,32 +9,32 @@ on: - main jobs: - build-virt32: + build-so3: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + CONFIG: ['virt32_defconfig', + 'virt64_defconfig'] steps: - name: Checkout repository uses: actions/checkout@v3 - name: Build run: | - docker run --rm -v "${PWD}:/so3" ghcr.io/smartobjectoriented/so3-env:main bash -c "cd so3 && make virt32_defconfig && make -j" - - build-virt64: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Build - run: | - docker run --rm -v "${PWD}:/so3" ghcr.io/smartobjectoriented/so3-env:main bash -c "cd so3 && make virt64_defconfig && make -j" + docker run --rm -v "${PWD}:/so3" ghcr.io/smartobjectoriented/so3-env:main bash -c "cd so3 && make ${{ matrix.CONFIG }} virt32_defconfig && make -j`nproc`" build-usr: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + CMAKE_TOOLCHAIN_FILE: ['aarch64_toolchain.cmake', + 'arm_toolchain.cmake'] steps: - name: Checkout repository uses: actions/checkout@v3 - name: Build run: | - docker run --rm -t -v "${PWD}:/so3" ghcr.io/smartobjectoriented/so3-env:main bash -c "cd usr && ./build.sh" + docker run --rm -t -v "${PWD}:/so3" ghcr.io/smartobjectoriented/so3-env:main bash -c "mkdir usr/build && cd usr/build && cmake --no-warn-unused-cli -DCMAKE_C_FLAGS='-Werror' -Wno-dev -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../${{matrix.CMAKE_TOOLCHAIN_FILE }} .. && make -j`nproc`" diff --git a/usr/aarch64_toolchain.cmake b/usr/aarch64_toolchain.cmake index f379f2d8a..72a2dcc22 100644 --- a/usr/aarch64_toolchain.cmake +++ b/usr/aarch64_toolchain.cmake @@ -21,8 +21,8 @@ set(CMAKE_C_COMPILER "aarch64-none-linux-gnu-gcc") set(CMAKE_C_LINK_EXECUTABLE "aarch64-none-linux-gnu-ld -o ") set(CMAKE_ASM_COMPILER "aarch64-none-linux-gnu-gcc") -set(CMAKE_C_FLAGS "-Wall -O0 -std=c99 -D_GNU_SOURCE -nostdlib -O0 -pipe -Wall -D__ARM64__ \ - -g -ffreestanding -fno-common") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O0 -std=c99 -D_GNU_SOURCE -nostdlib -pipe \ + -D__ARM64__ -g -ffreestanding -fno-common") set(CMAKE_ASM_FLAGS_DEBUG "-D__ASSEMBLY__") diff --git a/usr/arm_toolchain.cmake b/usr/arm_toolchain.cmake index aa9a92b8e..44bc37b8a 100644 --- a/usr/arm_toolchain.cmake +++ b/usr/arm_toolchain.cmake @@ -21,8 +21,8 @@ set(CMAKE_C_COMPILER "arm-none-eabi-gcc") set(CMAKE_C_LINK_EXECUTABLE "arm-none-eabi-ld -o ") set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc") -set(CMAKE_C_FLAGS "-Wall -O0 -std=c99 -D_GNU_SOURCE -nostdlib -O0 -pipe -Wall -D__ARM__ -marm \ - -mno-thumb-interwork -g -ffreestanding -fno-common") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O0 -std=c99 -D_GNU_SOURCE -nostdlib \ + -pipe -Wall -D__ARM__ -marm -mno-thumb-interwork -g -ffreestanding -fno-common") set(CMAKE_ASM_FLAGS_DEBUG "-D__ARM__ -D__ASSEMBLY__") diff --git a/usr/src/mydev_test.c b/usr/src/mydev_test.c index 2a4f868c6..edd150852 100644 --- a/usr/src/mydev_test.c +++ b/usr/src/mydev_test.c @@ -4,8 +4,8 @@ #include #include -int main(void) -{ +int main(void) { + char write_buffer[20]; char read_buffer[20]; @@ -18,4 +18,5 @@ int main(void) printf("Wrote: %s - Read %s\n", write_buffer, read_buffer); assert(!strcmp(write_buffer, read_buffer)); + return 0; } diff --git a/usr/src/sh.c b/usr/src/sh.c index 9be1243f7..24fef8181 100644 --- a/usr/src/sh.c +++ b/usr/src/sh.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -97,24 +97,20 @@ void escape_arrow_key(char *buffer, int size) { * More secure way and escaped way to get user input */ void get_user_input(char *buffer, int buf_size) { - if (buffer == NULL || buf_size <= 0) { - return NULL; - } - - memset(buffer,0,buf_size); - - if (fgets(buffer, buf_size, stdin) != NULL) { - escape_arrow_key(buffer,buf_size); + if (buffer == NULL || buf_size <= 0) { + return; + } + + memset(buffer, 0, buf_size); + + if (fgets(buffer, buf_size, stdin) != NULL) { + escape_arrow_key(buffer, buf_size); trim(buffer, buf_size); - size_t len = strlen(buffer); - if (len > 0 && buffer[len - 1] == '\n') { - buffer[len - 1] = '\0'; - } - - return buffer; - } - - return NULL; + size_t len = strlen(buffer); + if (len > 0 && buffer[len - 1] == '\n') { + buffer[len - 1] = '\0'; + } + } } /* @@ -333,8 +329,8 @@ void sigint_sh_handler(int sig) { /* * Main entry point of the shell application. */ -void main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { + char user_input[80]; int i; struct sigaction sa; diff --git a/usr/src/stress/lv_demo_stress.c b/usr/src/stress/lv_demo_stress.c index cd8b8e590..489111b46 100644 --- a/usr/src/stress/lv_demo_stress.c +++ b/usr/src/stress/lv_demo_stress.c @@ -430,7 +430,7 @@ static int count = 0; count++; if (count == 5) for (i = 0; i < 5; i++) - printf("## Elapsed time: %lld microseconds.\n", tv_end[i].tv_usec - tv_start[i].tv_usec); + LV_LOG_INFO("## Elapsed time: %lld microseconds.\n", tv_end[i].tv_usec - tv_start[i].tv_usec); state = -2; diff --git a/usr/src/stress/lvgl_perf.c b/usr/src/stress/lvgl_perf.c index 0f807a1ed..373edb221 100644 --- a/usr/src/stress/lvgl_perf.c +++ b/usr/src/stress/lvgl_perf.c @@ -45,13 +45,6 @@ /* Screen resolution. */ static uint32_t scr_hres, scr_vres, *fbp; -/* File descriptor of the mouse and keyboard input device. */ -static int mfd; -static int kfd; - -/* lvgl group for the keyboard. */ -static lv_group_t *keyboard_group; - /* Used to measure the duration of execution */ struct timeval tv_start, tv_end; static uint64_t delta; @@ -216,8 +209,6 @@ int fb_init(void) int main(int argc, char **argv) { - pthread_t tick_thread; - printf("LVGL Performance test\n"); /* Initialization of lvgl. */