Skip to content

Commit

Permalink
Merge pull request #3 from discip/translation-up
Browse files Browse the repository at this point in the history
translation update
  • Loading branch information
discip authored Oct 20, 2022
2 parents 2653345 + c12409e commit b66cd06
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 86 deletions.
12 changes: 6 additions & 6 deletions Translations/translation_SK.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"UndervoltageString": "Nízke napätie",
"InputVoltageString": "Vstupné U: ",
"SleepingSimpleString": "Chrr",
"SleepingAdvancedString": "Pokojový režim..",
"SleepingAdvancedString": "Pokojový režim.",
"SleepingTipAdvancedString": "Hrot:",
"OffString": "Vyp",
"DeviceFailedValidationWarning": "Your device is most likely a counterfeit!"
"DeviceFailedValidationWarning": "Vaše zariadenie je pravdepodobne falzifikát!"
},
"messagesWarn": {
"ResetOKMessage": "Reset OK",
Expand Down Expand Up @@ -311,7 +311,7 @@
"LanguageSwitch": {
"text2": [
"Jazyk:",
" SK Slovenčina"
" SK Slovenčina"
],
"desc": ""
},
Expand All @@ -331,10 +331,10 @@
},
"LOGOTime": {
"text2": [
"Boot logo",
"duration"
"Trvanie",
"boot loga"
],
"desc": "Set boot logo duration (s=seconds)"
"desc": "Doba trvania boot loga (s=sekundy)"
}
}
}
12 changes: 5 additions & 7 deletions source/Core/BSP/MHP30/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
#include "stm32f1xx_hal.h"
#include "string.h"

static uint16_t settings_page[512] __attribute__((section(".settings_page")));
#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024))


uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
FLASH_EraseInitTypeDef pEraseInit;
pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES;
pEraseInit.Banks = FLASH_BANK_1;
pEraseInit.NbPages = 1;
pEraseInit.PageAddress = (uint32_t)settings_page;
pEraseInit.PageAddress = (uint32_t)SETTINGS_START_PAGE;
uint32_t failingAddress = 0;
resetWatchdog();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR | FLASH_FLAG_BSY);
Expand All @@ -32,13 +33,10 @@ uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
HAL_FLASH_Unlock();
for (uint16_t i = 0; i < (length / 2); i++) {
resetWatchdog();
HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, (uint32_t)&settings_page[i], data[i]);
HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint32_t)), data[i]);
}
HAL_FLASH_Lock();
return 1;
}

void flash_read_buffer(uint8_t *buffer, const uint16_t length) {
memset(buffer, 0, length);
memcpy(buffer, settings_page, length);
}
void flash_read_buffer(uint8_t *buffer, const uint16_t length) { memcpy(buffer, (uint8_t*)SETTINGS_START_PAGE, length); }
11 changes: 0 additions & 11 deletions source/Core/BSP/MHP30/stm32f103.ld
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,6 @@ SECTIONS
_edata = .; /* define a global symbol at data end */
} >RAM AT> ROM

.logo_page (NOLOAD) :
{
. = ABSOLUTE(__FLASH_END_ADDR__ - 2048);
KEEP (*(.logo_page*))
} > ROM

.settings_page (NOLOAD) :
{
. = ABSOLUTE(__FLASH_END_ADDR__ - 1024);
KEEP (*(.settings_page*))
} > ROM

.bss :
{
Expand Down
37 changes: 0 additions & 37 deletions source/Core/BSP/Miniware/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,66 +29,29 @@ void resetWatchdog() { HAL_IWDG_Refresh(&hiwdg); }
static const uint16_t NTCHandleLookup[] = {
// ADC Reading , Temp in C
29189, 0, //
29014, 1, //
28832, 2, //
28644, 3, //
28450, 4, //
28249, 5, //
28042, 6, //
27828, 7, //
27607, 8, //
27380, 9, //
27146, 10, //
26906, 11, //
26660, 12, //
26407, 13, //
26147, 14, //
25882, 15, //
25610, 16, //
25332, 17, //
25049, 18, //
24759, 19, //
24465, 20, //
24164, 21, //
23859, 22, //
23549, 23, //
23234, 24, //
22915, 25, //
22591, 26, //
22264, 27, //
21933, 28, //
21599, 29, //
21261, 30, //
20921, 31, //
20579, 32, //
20234, 33, //
19888, 34, //
19541, 35, //
19192, 36, //
18843, 37, //
18493, 38, //
18143, 39, //
17793, 40, //
17444, 41, //
17096, 42, //
16750, 43, //
16404, 44, //
16061, 45, //
// 15719, 46, //
// 15380, 47, //
// 15044, 48, //
// 14710, 49, //
// 14380, 50, //
// 14053, 51, //
// 13729, 52, //
// 13410, 53, //
// 13094, 54, //
// 12782, 55, //
// 12475, 56, //
// 12172, 57, //
// 11874, 58, //
// 11580, 59, //
// 11292, 60, //
};
#endif

Expand Down
4 changes: 2 additions & 2 deletions source/Core/BSP/Miniware/Vendor/CMSIS/Include/cmsis_gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) {
\return PSP Register value
*/
__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) {
register uint32_t result;
uint32_t result;

__ASM volatile("MRS %0, psp\n" : "=r"(result));
return (result);
Expand All @@ -143,7 +143,7 @@ __attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProc
\return MSP Register value
*/
__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) {
register uint32_t result;
uint32_t result;

__ASM volatile("MRS %0, msp\n" : "=r"(result));
return (result);
Expand Down
8 changes: 4 additions & 4 deletions source/Core/BSP/Miniware/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
#include "stm32f1xx_hal.h"
#include "string.h"

static uint16_t settings_page[512] __attribute__((section(".settings_page")));
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))

uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
FLASH_EraseInitTypeDef pEraseInit;
pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES;
pEraseInit.Banks = FLASH_BANK_1;
pEraseInit.NbPages = 1;
pEraseInit.PageAddress = (uint32_t)settings_page;
pEraseInit.PageAddress = (uint32_t)SETTINGS_START_PAGE;
uint32_t failingAddress = 0;
resetWatchdog();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR | FLASH_FLAG_BSY);
Expand All @@ -32,10 +32,10 @@ uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
HAL_FLASH_Unlock();
for (uint16_t i = 0; i < (length / 2); i++) {
resetWatchdog();
HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, (uint32_t)&settings_page[i], data[i]);
HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint32_t)), data[i]);
}
HAL_FLASH_Lock();
return 1;
}

void flash_read_buffer(uint8_t *buffer, const uint16_t length) { memcpy(buffer, settings_page, length); }
void flash_read_buffer(uint8_t *buffer, const uint16_t length) { memcpy(buffer, (uint8_t*)SETTINGS_START_PAGE, length); }
11 changes: 0 additions & 11 deletions source/Core/BSP/Miniware/stm32f103.ld
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,6 @@ SECTIONS
_edata = .; /* define a global symbol at data end */
} >RAM AT> ROM

.logo_page (NOLOAD) :
{
. = ABSOLUTE(__FLASH_END_ADDR__ - 2048);
KEEP (*(.logo_page*))
} > ROM

.settings_page (NOLOAD) :
{
. = ABSOLUTE(__FLASH_END_ADDR__ - 1024);
KEEP (*(.settings_page*))
} > ROM

.bss :
{
Expand Down
2 changes: 0 additions & 2 deletions source/Core/BSP/Pinecil/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "gd32vf103_libopt.h"
#include "string.h"
#define FMC_PAGE_SIZE ((uint16_t)0x400U)
// static uint16_t settings_page[FMC_PAGE_SIZE] __attribute__ ((section (".settings_page")));
// Linker script doesnt want to play, so for now its hard coded
#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024))
uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ extern "C" {
* These settings should not be altered.
*-----------------------------------------------------------
*/
#include "FreeRTOSConfig.h"
#include <stddef.h>
#include <stdint.h>

Expand Down
14 changes: 8 additions & 6 deletions source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ S_SRCS := $(shell find $(MINIWARE_STARTUP_DIR) -type f -name '*.S')
LDSCRIPT=$(MINIWARE_LD_FILE)
DEV_GLOBAL_DEFS= -D STM32F103T8Ux -D STM32F1 -D STM32 -D USE_HAL_DRIVER -D STM32F103xB -D USE_RTOS_SYSTICK -D GCC_ARMCM3 \
-D ARM_MATH_CM3 \
-D STM32F10X_MD
DEV_LDFLAGS=
-D STM32F10X_MD
DEV_LDFLAGS= -Wl,--wrap=printf -Wl,--no-wchar-size-warning
DEV_AFLAGS=
DEV_CFLAGS= -D VECT_TAB_OFFSET=$(bootldr_size)U
DEV_CXXFLAGS=
CPUFLAGS= -mcpu=cortex-m3 \
-mthumb \
-mfloat-abi=soft
flash_size=64k
flash_size=62k
bootldr_size=0x4000
DEVICE_DFU_ADDRESS=0x08004000
DEVICE_DFU_VID_PID=0x1209:0xDB42
Expand All @@ -186,7 +186,7 @@ DEV_CXXFLAGS=
CPUFLAGS= -mcpu=cortex-m3 \
-mthumb \
-mfloat-abi=soft
flash_size=128k
flash_size=126k
bootldr_size=32k
DEVICE_DFU_ADDRESS=0x08008000
DEVICE_DFU_VID_PID=0x1209:0xDB42
Expand Down Expand Up @@ -313,7 +313,7 @@ $(shell find $(DEVICE_BSP_DIR) -type d \( $(EXCLUDED_DIRS) \) -prune -false -o
$(shell find $(SOURCE_MIDDLEWARES_DIR) -type f -name '*.cpp')

# code optimisation ------------------------------------------------------------
OPTIM=-Os -flto -finline-small-functions -findirect-inlining -fdiagnostics-color -ffunction-sections -fdata-sections -fshort-enums -fsingle-precision-constant -fno-common
OPTIM=-Os -fshort-wchar -flto -finline-small-functions -findirect-inlining -fdiagnostics-color -ffunction-sections -fdata-sections -fshort-enums -fsingle-precision-constant -fno-common

# global defines ---------------------------------------------------------------
GLOBAL_DEFINES += $(DEV_GLOBAL_DEFS) -D USE_RTOS_SYSTICK -D MODEL_$(model) -D VECT_TAB_OFFSET=$(bootldr_size)U -fshort-wchar
Expand Down Expand Up @@ -343,6 +343,7 @@ endif
CC=$(COMPILER_PREFIX)-gcc
CPP=$(COMPILER_PREFIX)-g++
OBJCOPY=$(COMPILER_PREFIX)-objcopy
SIZE=$(COMPILER_PREFIX)-size
OBJDUMP=$(COMPILER_PREFIX)-objdump
# use gcc in assembler mode so we can use defines etc in assembly
AS=$(COMPILER_PREFIX)-gcc -x assembler-with-cpp
Expand Down Expand Up @@ -405,7 +406,7 @@ CXXFLAGS=$(DEV_CXXFLAGS) \
-D${COMPILER} \
-MMD \
$(CHECKOPTIONS) \
-std=c++14 \
-std=c++17 \
$(OPTIM) \
-fno-rtti \
-fno-exceptions \
Expand Down Expand Up @@ -469,6 +470,7 @@ firmware-%: $(HEXFILE_DIR)/$(model)_%.hex $(HEXFILE_DIR)/$(model)_%.bin $(HEXFIL

%.bin : %.elf Makefile
$(OBJCOPY) $< -O binary $@
$(SIZE) $<

%.dfu : %.bin Makefile
python3 dfuse-pack.py -b $(DEVICE_DFU_ADDRESS)@0:$< -D $(DEVICE_DFU_VID_PID) $@
Expand Down

0 comments on commit b66cd06

Please sign in to comment.