From 22d0b0d6434b6574985793ca36d85e954e1782a5 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Mon, 20 Jun 2022 19:16:09 +1000 Subject: [PATCH] Private links --- source/CMake/gd32vf1.cmake | 1 - source/CMakeLists.txt | 4 +- source/Core/BSP/BSP.h | 1 - source/Core/BSP/CMakeLists.txt | 2 +- source/Core/BSP/Pine64/CMakeLists.txt | 82 +++++++++++----------- source/Core/BSP/Pine64/configuration.h | 1 - source/Core/Drivers/BootLogo.cpp | 1 + source/Core/Drivers/CMakeLists.txt | 2 +- source/Core/Drivers/Font.h | 2 +- source/Core/Drivers/OLED.cpp | 33 +++++++++ source/Core/Drivers/OLED.hpp | 41 +++-------- source/Core/Drivers/USBPD.cpp | 1 + source/Core/LangSupport/CMakeLists.txt | 5 +- source/Core/Src/CMakeLists.txt | 4 +- source/Core/Src/QC3.h | 6 -- source/Core/Src/ScrollMessage.cpp | 2 +- source/Core/Src/gui.hpp | 40 ----------- source/Core/Threads/CMakeLists.txt | 2 +- source/Middlewares/FreeRTOS/CMakeLists.txt | 2 +- 19 files changed, 98 insertions(+), 134 deletions(-) delete mode 100644 source/Core/Src/gui.hpp diff --git a/source/CMake/gd32vf1.cmake b/source/CMake/gd32vf1.cmake index 6b7945b1..78ba05f6 100644 --- a/source/CMake/gd32vf1.cmake +++ b/source/CMake/gd32vf1.cmake @@ -4,4 +4,3 @@ set(CORE_FLAGS "-march=rv32imac -mabi=ilp32 -mcmodel=medlow -fno-builtin -nostar add_definitions(${CORE_FLAGS}) # link with linker file target_link_libraries(${elf_file} PUBLIC -T ${CMAKE_CURRENT_SOURCE_DIR}/linkers/gd32vf103.ld) -# target_link_libraries(${elf_file} PUBLIC -nostartfiles --specs=${CMAKE_CURRENT_SOURCE_DIR}/patch.specs) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 141b7984..fe519bca 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -31,7 +31,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) project(IronOS - #VERSION 0.0.0.0 LANGUAGES C CXX ASM ) #Setup outputs @@ -59,7 +58,7 @@ add_subdirectory(Middlewares) -target_link_libraries(${elf_file} PUBLIC BSP mainSource threads FreeRTOS languages drivers BSPImplementation) +target_link_libraries(${elf_file} PRIVATE BSP mainSource threads FreeRTOS languages BSPImplementation drivers USBPDLib) if (MODEL STREQUAL TS100 OR MODEL STREQUAL TS80 OR MODEL STREQUAL TS80P) include(stm32f1) @@ -80,7 +79,6 @@ target_compile_options(${elf_file} PRIVATE ${additional_compiler_flags}) target_link_libraries(${elf_file} PRIVATE ${additional_linker_flags}) # remove unused sections -target_link_libraries(${elf_file} PUBLIC "-g -Wl,--gc-sections") diff --git a/source/Core/BSP/BSP.h b/source/Core/BSP/BSP.h index dd41bc7f..46cd38da 100644 --- a/source/Core/BSP/BSP.h +++ b/source/Core/BSP/BSP.h @@ -3,7 +3,6 @@ #include "BSP_Power.h" #include "BSP_QC.h" #include "Defines.h" -#include "configuration.h" #include #include /* diff --git a/source/Core/BSP/CMakeLists.txt b/source/Core/BSP/CMakeLists.txt index b54db137..e368a823 100644 --- a/source/Core/BSP/CMakeLists.txt +++ b/source/Core/BSP/CMakeLists.txt @@ -7,7 +7,7 @@ BSP_Common.c add_library(BSP ${sources}) target_include_directories(BSP PUBLIC .) -target_link_libraries(BSP PUBLIC mainSource BSPImplementation) +target_link_libraries(BSP PUBLIC FreeRTOS) if (MODEL STREQUAL TS100 OR MODEL STREQUAL TS80 OR MODEL STREQUAL TS80P) add_subdirectory(Miniware) diff --git a/source/Core/BSP/Pine64/CMakeLists.txt b/source/Core/BSP/Pine64/CMakeLists.txt index 119941bf..2a05c432 100644 --- a/source/Core/BSP/Pine64/CMakeLists.txt +++ b/source/Core/BSP/Pine64/CMakeLists.txt @@ -7,6 +7,46 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Sour set(sources +# Vendor Code +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/OS/FreeRTOS/Source/portable/GCC/portasm.S +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/OS/FreeRTOS/Source/portable/GCC/port.c + +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/gd32vf103_soc.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/system_gd32vf103.c + +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_adc.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_bkp.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_crc.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_dac.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_dbg.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_dma.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_eclic.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_exmc.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_exti.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_fmc.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_fwdgt.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_gpio.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_i2c.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_pmu.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_rcu.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_rtc.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_spi.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_timer.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_usart.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_wwdgt.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/n200_func.c + +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/GCC/intexc_gd32vf103.S +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/GCC/startup_gd32vf103.S + +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/ +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/close.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/fstat.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/gettimeofday.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/isatty.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/lseek.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/read.c +${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/sbrk.c BSP.cpp Debug.cpp I2C_Wrapper.cpp @@ -19,46 +59,6 @@ set(sources Setup.cpp Power.cpp QC_GPIO.cpp - # Vendor Code - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/OS/FreeRTOS/Source/portable/GCC/portasm.S - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/OS/FreeRTOS/Source/portable/GCC/port.c - - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/gd32vf103_soc.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/system_gd32vf103.c - - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_adc.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_bkp.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_crc.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_dac.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_dbg.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_dma.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_eclic.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_exmc.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_exti.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_fmc.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_fwdgt.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_gpio.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_i2c.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_pmu.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_rcu.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_rtc.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_spi.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_timer.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_usart.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_wwdgt.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Drivers/n200_func.c - - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/GCC/intexc_gd32vf103.S - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/GCC/startup_gd32vf103.S - - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/ - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/close.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/fstat.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/gettimeofday.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/isatty.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/lseek.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/read.c - ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/sbrk.c ) @@ -66,7 +66,7 @@ set(sources add_library(BSPImplementation ${sources}) target_include_directories(BSPImplementation PUBLIC . ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/NMSIS/Core/Include ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/OS/FreeRTOS/Source/portable/GCC ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Include ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/ ${CMAKE_CURRENT_SOURCE_DIR}/Vendor/SoC/gd32vf103/Common/Source/Stubs/) target_compile_definitions (BSPImplementation PUBLIC -DRTOS_FREERTOS -DDOWNLOAD_MODE=DOWNLOAD_MODE_FLASHXIP -DUSE_RTOS_SYSTICK -DVECT_TAB_OFFSET=0U) -target_link_libraries(BSPImplementation PUBLIC brieflz BSP mainSource drivers threads drivers) +target_link_libraries(BSPImplementation PRIVATE brieflz BSP threads drivers mainSource) # target_link_libraries(${elf_file} PUBLIC -Wl,--defsym=__FLASH_SIZE__=128k -Wl,--defsym=__BOOTLDR_SIZE__=0) diff --git a/source/Core/BSP/Pine64/configuration.h b/source/Core/BSP/Pine64/configuration.h index 27dcd4cc..4eec2780 100644 --- a/source/Core/BSP/Pine64/configuration.h +++ b/source/Core/BSP/Pine64/configuration.h @@ -1,6 +1,5 @@ #ifndef CONFIGURATION_H_ #define CONFIGURATION_H_ -#include "Settings.h" #include /** * Configuration.h diff --git a/source/Core/Drivers/BootLogo.cpp b/source/Core/Drivers/BootLogo.cpp index 5113fadb..50e3a330 100644 --- a/source/Core/Drivers/BootLogo.cpp +++ b/source/Core/Drivers/BootLogo.cpp @@ -2,6 +2,7 @@ #include "BSP.h" #include "Buttons.hpp" #include "OLED.hpp" +#include "Settings.h" #include "cmsis_os.h" #define LOGO_PAGE_LENGTH 1024 diff --git a/source/Core/Drivers/CMakeLists.txt b/source/Core/Drivers/CMakeLists.txt index a257be80..8111d139 100644 --- a/source/Core/Drivers/CMakeLists.txt +++ b/source/Core/Drivers/CMakeLists.txt @@ -19,7 +19,7 @@ Utils.cpp add_library(drivers ${sources}) -target_link_libraries(drivers PUBLIC BSP USBPDLib) +target_link_libraries(drivers PRIVATE BSP BSPImplementation mainSource languages PUBLIC USBPDLib FreeRTOS) target_include_directories(drivers PUBLIC .) add_subdirectory(usb-pd) \ No newline at end of file diff --git a/source/Core/Drivers/Font.h b/source/Core/Drivers/Font.h index d3fc1723..89a5009b 100644 --- a/source/Core/Drivers/Font.h +++ b/source/Core/Drivers/Font.h @@ -9,7 +9,7 @@ #ifndef FONT_H_ #define FONT_H_ -#include "Translation.h" +#include #define FONT_12_WIDTH 12 // THE MAIN FONTS ARE NO LONGER HERE, MOVED TO PYTHON AUTO GEN diff --git a/source/Core/Drivers/OLED.cpp b/source/Core/Drivers/OLED.cpp index ab436e0e..e6dd45a3 100644 --- a/source/Core/Drivers/OLED.cpp +++ b/source/Core/Drivers/OLED.cpp @@ -631,3 +631,36 @@ void OLED::drawHeatSymbol(uint8_t state) { } bool OLED::isInitDone() { return initDone; } +bool OLED::getRotation() { +#ifdef OLED_FLIP + return !inLeftHandedMode; +#else + return inLeftHandedMode; +#endif +} + +void OLED::setCursor(int16_t x, int16_t y) { + cursor_x = x; + cursor_y = y; +} +void OLED::refresh() { + I2C_CLASS::Transmit(DEVICEADDR_OLED, screenBuffer, FRAMEBUFFER_START + (OLED_WIDTH * 2)); + // DMA tx time is ~ 20mS Ensure after calling this you delay for at least 25ms + // or we need to goto double buffering +} + +void OLED::setDisplayState(OLED::DisplayState state) { + displayState = state; + screenBuffer[1] = (state == ON) ? 0xAF : 0xAE; +} + +// Clears the buffer +void OLED::clearScreen() { memset(firstStripPtr, 0, OLED_WIDTH * 2); } +// Draws the battery level symbol +void OLED::drawBattery(uint8_t state) { drawSymbol(3 + (state > 10 ? 10 : state)); } +// Draws a checkbox +void OLED::drawCheckbox(bool state) { drawSymbol((state) ? 16 : 17); } + +void OLED::drawImage(const uint8_t *buffer, uint8_t x, uint8_t width) { drawArea(x, 0, width, 16, buffer); } + +int16_t OLED::getCursorX() { return cursor_x; } \ No newline at end of file diff --git a/source/Core/Drivers/OLED.hpp b/source/Core/Drivers/OLED.hpp index 0d6f790c..6a820916 100644 --- a/source/Core/Drivers/OLED.hpp +++ b/source/Core/Drivers/OLED.hpp @@ -14,13 +14,6 @@ #include #include #include -#ifdef __cplusplus -extern "C" { -#endif -#include "FreeRTOS.h" -#ifdef __cplusplus -} -#endif #ifdef OLED_I2CBB #include "I2CBB.hpp" @@ -48,46 +41,30 @@ public: static void initialize(); // Startup the I2C coms (brings screen out of reset etc) static bool isInitDone(); // Draw the buffer out to the LCD using the DMA Channel - static void refresh() { - I2C_CLASS::Transmit(DEVICEADDR_OLED, screenBuffer, FRAMEBUFFER_START + (OLED_WIDTH * 2)); - // DMA tx time is ~ 20mS Ensure after calling this you delay for at least 25ms - // or we need to goto double buffering - } + static void refresh(); - static void setDisplayState(DisplayState state) { - displayState = state; - screenBuffer[1] = (state == ON) ? 0xAF : 0xAE; - } + static void setDisplayState(DisplayState state); static void setRotation(bool leftHanded); // Set the rotation for the screen // Get the current rotation of the LCD - static bool getRotation() { -#ifdef OLED_FLIP - return !inLeftHandedMode; -#else - return inLeftHandedMode; -#endif - } + static bool getRotation(); static void setBrightness(uint8_t contrast); static void setInverseDisplay(bool inverted); - static int16_t getCursorX() { return cursor_x; } + static int16_t getCursorX(); static void print(const char *string, FontStyle fontStyle); // Draw a string to the current location, with selected font static void printWholeScreen(const char *string); // Set the cursor location by pixels - static void setCursor(int16_t x, int16_t y) { - cursor_x = x; - cursor_y = y; - } + static void setCursor(int16_t x, int16_t y); // Draws an image to the buffer, at x offset from top to bottom (fixed height renders) - static void drawImage(const uint8_t *buffer, uint8_t x, uint8_t width) { drawArea(x, 0, width, 16, buffer); } + static void drawImage(const uint8_t *buffer, uint8_t x, uint8_t width); // Draws a number at the current cursor location static void printNumber(uint16_t number, uint8_t places, FontStyle fontStyle, bool noLeaderZeros = true); // Clears the buffer - static void clearScreen() { memset(firstStripPtr, 0, OLED_WIDTH * 2); } + static void clearScreen(); // Draws the battery level symbol - static void drawBattery(uint8_t state) { drawSymbol(3 + (state > 10 ? 10 : state)); } + static void drawBattery(uint8_t state); // Draws a checkbox - static void drawCheckbox(bool state) { drawSymbol((state) ? 16 : 17); } + static void drawCheckbox(bool state); static void debugNumber(int32_t val, FontStyle fontStyle); static void drawHex(uint32_t x, FontStyle fontStyle); static void drawSymbol(uint8_t symbolID); // Used for drawing symbols of a predictable width diff --git a/source/Core/Drivers/USBPD.cpp b/source/Core/Drivers/USBPD.cpp index 4d01e055..5df975d6 100644 --- a/source/Core/Drivers/USBPD.cpp +++ b/source/Core/Drivers/USBPD.cpp @@ -1,4 +1,5 @@ #include "USBPD.h" +#include "Settings.h" #include "configuration.h" #if POW_PD diff --git a/source/Core/LangSupport/CMakeLists.txt b/source/Core/LangSupport/CMakeLists.txt index 4a601c95..e6140c2a 100644 --- a/source/Core/LangSupport/CMakeLists.txt +++ b/source/Core/LangSupport/CMakeLists.txt @@ -1,4 +1,7 @@ +if (LANG STREQUAL "") + message(FATAL_ERROR "You must specify a language") +endif() add_custom_command( @@ -18,5 +21,5 @@ lang_single.cpp add_library(languages ${sources}) -target_link_libraries(languages PUBLIC drivers brieflz ) +target_link_libraries(languages PRIVATE drivers brieflz mainSource ) diff --git a/source/Core/Src/CMakeLists.txt b/source/Core/Src/CMakeLists.txt index 7b586551..03c54d1a 100644 --- a/source/Core/Src/CMakeLists.txt +++ b/source/Core/Src/CMakeLists.txt @@ -1,7 +1,7 @@ set(sources freertos.c FreeRTOSHooks.c -gui.cpp +settingsGUI.cpp main.cpp power.cpp QC3.cpp @@ -14,4 +14,4 @@ Translation.cpp add_library(mainSource ${sources}) target_include_directories(mainSource PUBLIC .) -target_link_libraries(mainSource PUBLIC brieflz BSP FreeRTOS drivers languages) +target_link_libraries(mainSource PRIVATE brieflz BSP FreeRTOS drivers languages) diff --git a/source/Core/Src/QC3.h b/source/Core/Src/QC3.h index 1a99fe12..5571f2ff 100644 --- a/source/Core/Src/QC3.h +++ b/source/Core/Src/QC3.h @@ -8,14 +8,8 @@ #ifndef INC_QC3_H_ #define INC_QC3_H_ #include "stdint.h" -#ifdef __cplusplus -extern "C" { -#endif void seekQC(int16_t Vx10, uint16_t divisor); void startQC(uint16_t divisor); // Tries to negotiate QC for highest voltage, must be run after bool hasQCNegotiated(); // Returns true if a QC negotiation worked (we are using QC) -#ifdef __cplusplus -} -#endif #endif /* INC_QC3_H_ */ diff --git a/source/Core/Src/ScrollMessage.cpp b/source/Core/Src/ScrollMessage.cpp index 88bebfb7..4900d2c9 100644 --- a/source/Core/Src/ScrollMessage.cpp +++ b/source/Core/Src/ScrollMessage.cpp @@ -1,6 +1,6 @@ #include "ScrollMessage.hpp" - #include "OLED.hpp" +#include "Settings.h" #include "configuration.h" /** diff --git a/source/Core/Src/gui.hpp b/source/Core/Src/gui.hpp deleted file mode 100644 index 9905973f..00000000 --- a/source/Core/Src/gui.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * settingsGUI.h - * - * Created on: 3Sep.,2017 - * Author: Ben V. Brown - */ - -#ifndef GUI_HPP_ -#define GUI_HPP_ -#include "BSP.h" -#include "Settings.h" -#include "Translation.h" - -#define PRESS_ACCEL_STEP (TICKS_100MS / 3) -#define PRESS_ACCEL_INTERVAL_MIN TICKS_100MS -#define PRESS_ACCEL_INTERVAL_MAX (TICKS_100MS * 3) - -// GUI holds the menu structure and all its methods for the menu itself - -// Declarations for all the methods for the settings menu (at end of this file) - -// Struct for holding the function pointers and descriptions -typedef struct { - // The settings description index, please use the `SETTINGS_DESC` macro with - // the `SettingsItemIndex` enum. Use 0 for no description. - uint8_t description; - // return true if increment reached the maximum value - bool (*const incrementHandler)(void); - void (*const draw)(void); - bool (*const isVisible)(void); - // If this is set, we will automatically use the settings increment handler instead, set >= num settings to disable - SettingsOptions autoSettingOption; -} menuitem; - -void enterSettingsMenu(); -void GUIDelay(); -void warnUser(const char *warning, const int timeout); -extern const menuitem rootSettingsMenu[]; - -#endif /* GUI_HPP_ */ diff --git a/source/Core/Threads/CMakeLists.txt b/source/Core/Threads/CMakeLists.txt index bb233e92..e1b9867b 100644 --- a/source/Core/Threads/CMakeLists.txt +++ b/source/Core/Threads/CMakeLists.txt @@ -11,4 +11,4 @@ set(sources add_library(threads ${sources}) target_include_directories(threads PUBLIC .) -target_link_libraries(threads PUBLIC BSP FreeRTOS drivers languages) +target_link_libraries(threads PRIVATE mainSource drivers BSP FreeRTOS languages BSPImplementation ) diff --git a/source/Middlewares/FreeRTOS/CMakeLists.txt b/source/Middlewares/FreeRTOS/CMakeLists.txt index 30ace3db..e4f93453 100644 --- a/source/Middlewares/FreeRTOS/CMakeLists.txt +++ b/source/Middlewares/FreeRTOS/CMakeLists.txt @@ -13,5 +13,5 @@ CMSIS_RTOS/cmsis_os.c add_library(FreeRTOS ${sources}) #Reqired to be able to grab the freertos config header -target_link_libraries(FreeRTOS PUBLIC BSP BSPImplementation) +target_link_libraries(FreeRTOS PRIVATE BSP PUBLIC BSPImplementation) target_include_directories(FreeRTOS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/CMSIS_RTOS) \ No newline at end of file