Merge branch 'master' into aku_nfc_clean

This commit is contained in:
aanper 2020-10-21 12:21:53 +03:00
commit d818fe1d27
5 changed files with 27 additions and 9 deletions

View File

@ -6,7 +6,7 @@ AlignEscapedNewlines: Left
AlignOperands: true AlignOperands: true
AlignTrailingComments: false AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: true AllowShortIfStatementsOnASingleLine: true

View File

@ -41,20 +41,26 @@ GuiEvent* gui_event_alloc() {
} }
void gui_event_free(GuiEvent* gui_event) { void gui_event_free(GuiEvent* gui_event) {
osStatus_t status;
assert(gui_event); assert(gui_event);
gui_event_unlock(gui_event); gui_event_unlock(gui_event);
assert(osMessageQueueDelete(gui_event->mqueue) == osOK); status = osMessageQueueDelete(gui_event->mqueue);
assert(status == osOK);
free(gui_event); free(gui_event);
} }
void gui_event_lock(GuiEvent* gui_event) { void gui_event_lock(GuiEvent* gui_event) {
osStatus_t status;
assert(gui_event); assert(gui_event);
assert(osMutexAcquire(gui_event->lock_mutex, osWaitForever) == osOK); status = osMutexAcquire(gui_event->lock_mutex, osWaitForever);
assert(status == osOK);
} }
void gui_event_unlock(GuiEvent* gui_event) { void gui_event_unlock(GuiEvent* gui_event) {
osStatus_t status;
assert(gui_event); assert(gui_event);
assert(osMutexRelease(gui_event->lock_mutex) == osOK); status = osMutexRelease(gui_event->lock_mutex);
assert(status == osOK);
} }
void gui_event_messsage_send(GuiEvent* gui_event, GuiMessage* message) { void gui_event_messsage_send(GuiEvent* gui_event, GuiMessage* message) {
@ -64,10 +70,12 @@ void gui_event_messsage_send(GuiEvent* gui_event, GuiMessage* message) {
} }
GuiMessage gui_event_message_next(GuiEvent* gui_event) { GuiMessage gui_event_message_next(GuiEvent* gui_event) {
osStatus_t status;
assert(gui_event); assert(gui_event);
GuiMessage message; GuiMessage message;
gui_event_unlock(gui_event); gui_event_unlock(gui_event);
assert(osMessageQueueGet(gui_event->mqueue, &message, NULL, osWaitForever) == osOK); status = osMessageQueueGet(gui_event->mqueue, &message, NULL, osWaitForever);
assert(status == osOK);
gui_event_lock(gui_event); gui_event_lock(gui_event);
return message; return message;
} }

View File

@ -35,8 +35,10 @@ MenuEvent* menu_event_alloc() {
} }
void menu_event_free(MenuEvent* menu_event) { void menu_event_free(MenuEvent* menu_event) {
osStatus_t status;
assert(menu_event); assert(menu_event);
assert(osMessageQueueDelete(menu_event->mqueue) == osOK); status = osMessageQueueDelete(menu_event->mqueue);
assert(status == osOK);
free(menu_event); free(menu_event);
} }

View File

@ -4,6 +4,8 @@ ENV PATH /root/.cargo/bin:$PATH
RUN apt update && \ RUN apt update && \
apt install -y --no-install-recommends \ apt install -y --no-install-recommends \
software-properties-common \
gpg-agent \
make \ make \
gcc-arm-none-eabi \ gcc-arm-none-eabi \
binutils-arm-none-eabi \ binutils-arm-none-eabi \
@ -19,11 +21,17 @@ RUN apt update && \
python \ python \
python-pip \ python-pip \
libstdc++-arm-none-eabi-newlib \ libstdc++-arm-none-eabi-newlib \
libclang-10-dev \
clang-format-10 \
git \ git \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main"
RUN apt update && \
apt install -y --no-install-recommends \
libclang-12-dev \
clang-format-12 \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile=minimal --target thumbv7em-none-eabi thumbv7em-none-eabihf && \ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile=minimal --target thumbv7em-none-eabi thumbv7em-none-eabihf && \
rustup component add rustfmt --toolchain stable-x86_64-unknown-linux-gnu rustup component add rustfmt --toolchain stable-x86_64-unknown-linux-gnu

View File

@ -2,7 +2,7 @@
# set -e # set -e
CLANG_FORMAT_BIN="/usr/bin/clang-format-10" CLANG_FORMAT_BIN="/usr/bin/clang-format-12"
PATH="$HOME/.cargo/bin:${PATH}" PATH="$HOME/.cargo/bin:${PATH}"
PROJECT_DIR=$(pwd) PROJECT_DIR=$(pwd)