CHANGE: removed format lib
This commit is contained in:
parent
85c4d24e3b
commit
873b84cd5b
@ -59,7 +59,6 @@ else ()
|
|||||||
add_compile_options(-Og -g)
|
add_compile_options(-Og -g)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_subdirectory(Lib/fmt)
|
|
||||||
|
|
||||||
include_directories(USB_DEVICE/App USB_DEVICE/Target Core/Inc Drivers/STM32F4xx_HAL_Driver/Inc Drivers/STM32F4xx_HAL_Driver/Inc/Legacy Middlewares/ST/STM32_USB_Device_Library/Core/Inc Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc Drivers/CMSIS/Device/ST/STM32F4xx/Include Drivers/CMSIS/Include Middlewares/floatpump/Inc)
|
include_directories(USB_DEVICE/App USB_DEVICE/Target Core/Inc Drivers/STM32F4xx_HAL_Driver/Inc Drivers/STM32F4xx_HAL_Driver/Inc/Legacy Middlewares/ST/STM32_USB_Device_Library/Core/Inc Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc Drivers/CMSIS/Device/ST/STM32F4xx/Include Drivers/CMSIS/Include Middlewares/floatpump/Inc)
|
||||||
|
|
||||||
@ -75,8 +74,6 @@ add_link_options(-T ${LINKER_SCRIPT})
|
|||||||
|
|
||||||
add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT})
|
add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT})
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}.elf fmt::fmt-header-only)
|
|
||||||
|
|
||||||
set(HEX_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hex)
|
set(HEX_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hex)
|
||||||
set(BIN_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.bin)
|
set(BIN_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.bin)
|
||||||
|
|
||||||
|
@ -7,6 +7,6 @@
|
|||||||
|
|
||||||
// Auto generated header file containing the last git revision
|
// Auto generated header file containing the last git revision
|
||||||
|
|
||||||
#define GIT_HASH "c9c911b"
|
#define GIT_HASH "57ae289"
|
||||||
|
|
||||||
#endif //FLOATPUMP_GIT_REVISION_TEMPLATE_H
|
#endif //FLOATPUMP_GIT_REVISION_TEMPLATE_H
|
@ -2,9 +2,6 @@
|
|||||||
#include "usb_device.h"
|
#include "usb_device.h"
|
||||||
#include "usbd_cdc_if.h"
|
#include "usbd_cdc_if.h"
|
||||||
|
|
||||||
#include "fmt/core.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include "LCD_I2C_Driver.h"
|
#include "LCD_I2C_Driver.h"
|
||||||
#include "InitSequence.h"
|
#include "InitSequence.h"
|
||||||
#include "button_input.h"
|
#include "button_input.h"
|
||||||
@ -122,9 +119,6 @@ void CheckRefillConditions(Config_Store &cfg, io::PressureChannel &tankLevel, io
|
|||||||
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
Config_Store globalConfig;
|
|
||||||
globalConfig.loadFromFlash();
|
|
||||||
|
|
||||||
// Step 1: Initialize HAL
|
// Step 1: Initialize HAL
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
|
||||||
@ -141,12 +135,15 @@ int main(void) {
|
|||||||
MX_USART1_UART_Init();
|
MX_USART1_UART_Init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Disable Interrupt for Debouncing timer during display initialisation (exact timings are necessary)
|
//Disable Interrupt for Debouncing timer during display initialisation (exact timings are necessary)
|
||||||
HAL_NVIC_DisableIRQ(TIM2_IRQn);
|
HAL_NVIC_DisableIRQ(TIM2_IRQn);
|
||||||
LCD_I2C_Driver &display = floatpump::LCD_I2C_Driver::getInstance(hi2c1, SLAVE_ADDRESS_LCD);
|
LCD_I2C_Driver &display = floatpump::LCD_I2C_Driver::getInstance(hi2c1, SLAVE_ADDRESS_LCD);
|
||||||
HAL_NVIC_EnableIRQ(TIM2_IRQn);
|
HAL_NVIC_EnableIRQ(TIM2_IRQn);
|
||||||
|
|
||||||
|
//Restore configuration
|
||||||
|
Config_Store globalConfig;
|
||||||
|
globalConfig.loadFromFlash();
|
||||||
|
|
||||||
//Run init Sequence
|
//Run init Sequence
|
||||||
InitSequence initializer(display);
|
InitSequence initializer(display);
|
||||||
initializer.runInitSequence();
|
initializer.runInitSequence();
|
||||||
@ -267,7 +264,7 @@ int main(void) {
|
|||||||
|
|
||||||
display.LCDSetCursor(0, 0);
|
display.LCDSetCursor(0, 0);
|
||||||
display.LCDSendCString(
|
display.LCDSendCString(
|
||||||
const_cast<char *>(fmt::format("Fuellstand {:3} % ", tankLevel0.getPercent()).c_str()));
|
const_cast<char *>(std::string("Fuellstand " + std::to_string(tankLevel0.getPercent()) + " %").c_str()));
|
||||||
display.LCDSetCursor(0, 1);
|
display.LCDSetCursor(0, 1);
|
||||||
if (S_tankempty) {
|
if (S_tankempty) {
|
||||||
display.LCDSendCString(const_cast<char *>(std::string("Tank Wassermangel ").c_str()));
|
display.LCDSendCString(const_cast<char *>(std::string("Tank Wassermangel ").c_str()));
|
||||||
@ -292,9 +289,9 @@ int main(void) {
|
|||||||
if (S_refillcooldown > 0) {
|
if (S_refillcooldown > 0) {
|
||||||
int remaining_mins = S_refillcooldown / 60;
|
int remaining_mins = S_refillcooldown / 60;
|
||||||
if(remaining_mins > 0)
|
if(remaining_mins > 0)
|
||||||
display.LCDSendCString(const_cast<char *>(fmt::format("Nsp. wartet: {:3} min", S_refillcooldown / 60).c_str()));
|
display.LCDSendCString(const_cast<char *>(std::string("Nsp. wartet: min " + std::to_string( S_refillcooldown / 60)).c_str()));
|
||||||
else
|
else
|
||||||
display.LCDSendCString(const_cast<char *>(fmt::format("Nsp. wartet: {:3} s ", S_refillcooldown).c_str()));
|
display.LCDSendCString(const_cast<char *>(std::string("Nsp. wartet: s " + std::to_string(S_refillcooldown)).c_str()));
|
||||||
} else if (S_refillempty) {
|
} else if (S_refillempty) {
|
||||||
display.LCDSendCString(const_cast<char *>(std::string("Nachspeisung mangel ").c_str()));
|
display.LCDSendCString(const_cast<char *>(std::string("Nachspeisung mangel ").c_str()));
|
||||||
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
|
||||||
|
1
Lib/fmt
1
Lib/fmt
@ -1 +0,0 @@
|
|||||||
Subproject commit 676c2a107e9575663f79095d9b2c9d15168e1285
|
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Menu_Entry_Type_Delegate.h"
|
#include "Menu_Entry_Type_Delegate.h"
|
||||||
#include "fmt/core.h"
|
|
||||||
|
|
||||||
namespace floatpump {
|
namespace floatpump {
|
||||||
namespace menu {
|
namespace menu {
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define FLOATPUMP_MENU_ENTRY_TYPE_PERCENT_H
|
#define FLOATPUMP_MENU_ENTRY_TYPE_PERCENT_H
|
||||||
|
|
||||||
#include "Menu_Entry_Type_Delegate.h"
|
#include "Menu_Entry_Type_Delegate.h"
|
||||||
#include "fmt/core.h"
|
|
||||||
|
|
||||||
namespace floatpump::menu {
|
namespace floatpump::menu {
|
||||||
|
|
||||||
|
@ -13,9 +13,10 @@ namespace floatpump {
|
|||||||
|
|
||||||
std::string Menu_Entry_Type_Numeric::toString() {
|
std::string Menu_Entry_Type_Numeric::toString() {
|
||||||
if (m_entered) {
|
if (m_entered) {
|
||||||
return fmt::format("> {{:5}", *m_value);
|
return std::string("> " + std::to_string(*m_value));
|
||||||
} else {
|
} else {
|
||||||
return fmt::format(" {{:5}", *m_value); }
|
return std::string(" " + std::to_string(*m_value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu_Entry_Type_Numeric::u_press() {
|
void Menu_Entry_Type_Numeric::u_press() {
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
std::string floatpump::menu::Menu_Entry_Type_Percent::toString() {
|
std::string floatpump::menu::Menu_Entry_Type_Percent::toString() {
|
||||||
if (m_entered) {
|
if (m_entered) {
|
||||||
return fmt::format("> {:3} %", *m_value);
|
return std::string("> %" + std::to_string(*m_value));
|
||||||
} else {
|
} else {
|
||||||
return fmt::format(" {:3} %", *m_value);
|
return std::string(" %" + std::to_string(*m_value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user