Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
4 changes: 2 additions & 2 deletions usr/aarch64_toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ set(CMAKE_C_COMPILER "aarch64-none-linux-gnu-gcc")
set(CMAKE_C_LINK_EXECUTABLE "aarch64-none-linux-gnu-ld <OBJECTS> -o <TARGET> <LINK_LIBRARIES> <LINK_FLAGS> <LINK_LIBRARIES>")
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__")

Expand Down
4 changes: 2 additions & 2 deletions usr/arm_toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
set(CMAKE_C_LINK_EXECUTABLE "arm-none-eabi-ld <OBJECTS> -o <TARGET> <LINK_LIBRARIES> <LINK_FLAGS> <LINK_LIBRARIES>")
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__")

Expand Down
5 changes: 3 additions & 2 deletions usr/src/mydev_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <unistd.h>
#include <assert.h>

int main(void)
{
int main(void) {

char write_buffer[20];
char read_buffer[20];

Expand All @@ -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;
}
36 changes: 16 additions & 20 deletions usr/src/sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <sys/types.h>
#include <sys/wait.h>

#include <errno.h>
#include <syscall.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -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';
}
}
}

/*
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion usr/src/stress/lv_demo_stress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions usr/src/stress/lvgl_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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. */
Expand Down