Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Arrowhead wrappers #6

Merged
merged 41 commits into from
May 23, 2022
Merged
Changes from 4 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
98989c6
Add exit screen
jara001 Apr 6, 2022
8f4763c
Rename shutdown timeval to avoid conflicts
jara001 Apr 6, 2022
5a43f90
Add exit handler
jara001 Apr 6, 2022
5005930
Run exit handler on pressing second button
jara001 Apr 6, 2022
522e688
Merge branch 'feature/exit-application' into devel/arrowhead-final
jara001 Apr 7, 2022
2b1d840
Add git configure file for cmake
jara001 Apr 7, 2022
aed0463
Add git sequence to CMakeLists
jara001 Apr 7, 2022
0b36093
Display git version on exit screen
jara001 Apr 7, 2022
30564f9
Merge branch 'feature/git-versioning' into devel/arrowhead-final
jara001 Apr 8, 2022
55da123
Kill explicitly websocat on exit
jara001 Apr 8, 2022
91113b4
(.GI) Add git.h
jara001 Apr 8, 2022
e625be4
(F) Marking version dirty
jara001 Apr 8, 2022
418d7df
Reverse the functions order when pressing buttons
jara001 Apr 8, 2022
1133b06
Make start structs global
jara001 Apr 8, 2022
ec7b18e
Move usec_between slightly more to the top
jara001 Apr 8, 2022
399ac9d
Display progress on exit/shutdown
jara001 Apr 8, 2022
b219a70
Merge branch 'feature/exit-progress' into devel/arrowhead-final
jara001 Apr 8, 2022
0393658
Add Arrowhead Tools logo
jara001 Apr 12, 2022
599a772
Add backend overlay
jara001 Apr 12, 2022
b26e250
(.GI) Add scoreapp database
jara001 Apr 12, 2022
091e655
Get and display current branch
jara001 Apr 12, 2022
548543b
Exit the application during exit sequence
jara001 Apr 12, 2022
efdad50
Update metadata example of backend overlay to latest version
jara001 Apr 13, 2022
4dfd275
Add raspberry overlay as submodule
jara001 Apr 13, 2022
4a24b98
Update the raspberry overlay submodule
jara001 Apr 19, 2022
6dec827
Roll poweroff screen and show wireguard address
jara001 Apr 19, 2022
96933c2
Slow down the rolling
jara001 Apr 19, 2022
0c34261
(F) Set default value of wireguard address
jara001 Apr 19, 2022
fa5ca94
Hide wireguard address when not obtained
jara001 Apr 19, 2022
b519356
Set raspberry overlay submodule to track branch
jara001 Apr 20, 2022
7494469
Update the raspberry overlay submodule
jara001 Apr 20, 2022
d9fb602
Update backend-arrowhead readme
jara001 Apr 20, 2022
b93ff12
Add new draft of the readme
jara001 Apr 22, 2022
38df385
Add logo to backend overlay and add status messages
jara001 May 3, 2022
2695f3a
Add license file
jara001 May 12, 2022
d72a851
Merge branch 'devel/arrowhead-final' into main
jara001 May 12, 2022
d338215
Move arrowhead overlays to 'arrowhead' folder
jara001 May 23, 2022
29492ea
Update links in the readme and use term wrapper
jara001 May 23, 2022
4cb998b
(F) Path to the scoreapp in Arrowhead wrapper
jara001 May 23, 2022
39b5ab7
Change the license to TODO until resolved
jara001 May 23, 2022
ee001da
Rename the license file
jara001 May 23, 2022
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
52 changes: 52 additions & 0 deletions barrier/optic_barrier_sw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -2,6 +2,58 @@ cmake_minimum_required(VERSION 3.1.0)

project(optic_barrier_sw)

# Git versioning
set(PRE_CONFIGURE_FILE "git.h.in")
set(POST_CONFIGURE_FILE "git.h")

# Check whether we have git
execute_process(
COMMAND git --version
RESULT_VARIABLE GIT_CHECK
)

if("${GIT_CHECK}" EQUAL 0)
set(GIT_AVAILABLE true)
else()
set(GIT_AVAILABLE false)
endif()

# Preset variables
set(GIT_IS_DIRTY false)

if(GIT_AVAILABLE)
# Git describe
execute_process(
COMMAND git describe --always --tags
OUTPUT_VARIABLE GIT_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Commit hash
execute_process(
COMMAND git log -1 --format=%h
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Dirty
execute_process(
COMMAND git status --porcelain -uno
RESULT_VARIABLE GIT_DIRTY
)

if ("${GIT_DIRTY}" STREQUAL "")
set(GIT_IS_DIRTY false)
else()
set(GIT_IS_DIRTY true)
endif()
endif()

get_filename_component(PRE_CONFIGURE_FILE "${PRE_CONFIGURE_FILE}" ABSOLUTE)
get_filename_component(POST_CONFIGURE_FILE "${POST_CONFIGURE_FILE}" ABSOLUTE)

configure_file("${PRE_CONFIGURE_FILE}" "${POST_CONFIGURE_FILE}" @ONLY)

# If you want to use different compiler than arm-linux-gnueabihf-gcc, run cmake as:
# cmake -DHARDCODE_C_COMPILER=NO -DCMAKE_C_COMPILER=...
set(HARDCODE_C_COMPILER YES CACHE BOOL "Override user's (or default) value of CMAKE_C_COMPILER with 'arm-linux-gnueabihf-gcc'")
7 changes: 7 additions & 0 deletions barrier/optic_barrier_sw/git.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#define GIT_AVAILABLE @GIT_AVAILABLE@

#define GIT_DESCRIBE "@GIT_DESCRIBE@"

#define GIT_COMMIT_HASH "@GIT_COMMIT_HASH@"

#define GIT_IS_DIRTY @GIT_IS_DIRTY@
15 changes: 15 additions & 0 deletions barrier/optic_barrier_sw/main.c
Original file line number Diff line number Diff line change
@@ -40,6 +40,8 @@
#include "OLED_GUI.h"
#include "Show_Lib.h"

#include "git.h"

#define BARRIER_SIGNAL 0 // 30
#define UNIVERSAL_BUTTON1 19 // 24
#define UNIVERSAL_BUTTON2 26 // 25
@@ -182,6 +184,19 @@ void update_display(enum screen screen)
case EXIT: {
GUI_DisString_EN(0, 0, "Hold 5s to exit", &Font12, FONT_BACKGROUND, WHITE);

char version[100];

if (GIT_AVAILABLE) {
if (GIT_IS_DIRTY) {
sprintf(version, "%s-dirty", GIT_DESCRIBE);
} else {
sprintf(version, "%s", GIT_DESCRIBE);
}
} else {
sprintf(version, "Unknown version");
}

GUI_DisString_EN(0, 3 * Font8.Height, version, &Font8, FONT_BACKGROUND, WHITE);
break;
}
}