1
0
forked from me/IronOS

Merge branch 'dev' into Short-Detection

This commit is contained in:
Ben V. Brown
2023-08-02 15:52:49 +10:00
committed by GitHub
14 changed files with 155 additions and 18 deletions

View File

@@ -102,7 +102,10 @@ void setBuzzer(bool on);
uint8_t preStartChecks();
uint8_t preStartChecksDone();
// Check if the tip or output mosfet is shorted (if possible)
bool isTipShorted();
// Show the boot logo
void showBootLogo(void);
#ifdef __cplusplus
}
#endif

View File

@@ -1,6 +1,7 @@
// BSP mapping functions
#include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp"
#include "Pins.h"
#include "Setup.h"
@@ -472,4 +473,6 @@ uint64_t getDeviceID() {
uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; }
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -164,13 +164,13 @@
#define HARDWARE_MAX_WATTAGE_X10 650
#define TIP_THERMAL_MASS 65 // TODO, needs refinement
#define TIP_RESISTANCE 60 // x10 ohms, ~6 typical
#endif /* MHP30 */
#endif /* MHP30 */
#ifdef ACCEL_EXITS_ON_MOVEMENT
#define NO_SLEEP_MODE
#endif
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#define FLASH_LOGOADDR (0x08000000 + (126 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024))
#endif /* CONFIGURATION_H_ */

View File

@@ -1,6 +1,7 @@
// BSP mapping functions
#include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp"
#include "Pins.h"
#include "Setup.h"
@@ -414,4 +415,6 @@ uint8_t getTipInertia() {
#else
return TIP_THERMAL_MASS;
#endif
}
}
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -1,6 +1,7 @@
// BSP mapping functions
#include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp"
#include "IRQ.h"
#include "Pins.h"
@@ -97,4 +98,6 @@ bool isTipShorted() { return false; }
uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_MASS; }
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -1,6 +1,7 @@
// BSP mapping functions
#include "BSP.h"
#include "BootLogo.h"
#include "I2C_Wrapper.hpp"
#include "IRQ.h"
#include "Pins.h"
@@ -10,6 +11,7 @@
#include "Utils.h"
#include "configuration.h"
#include "crc32.h"
#include "hal_flash.h"
#include "history.hpp"
#include "main.hpp"
@@ -281,4 +283,11 @@ uint8_t getDeviceValidationStatus() {
uint32_t programmedHash = EF_Ctrl_Get_Key_Slot_w1();
uint32_t computedHash = gethash();
return programmedHash == computedHash ? 0 : 1;
}
}
void showBootLogo(void) {
uint8_t scratch[1024];
flash_read(FLASH_LOGOADDR - 0x23000000, scratch, 1024);
BootLogo::handleShowingLogo(scratch);
}

View File

@@ -22,7 +22,7 @@ __EM_SIZE =8K;
MEMORY
{
xip_memory (rx) : ORIGIN = 0x23000000, LENGTH = 1022K
xip_memory (rx) : ORIGIN = 0x23000000, LENGTH = 1008K /*1024 - 8K header - 4K*2 for settings and logo*/
itcm_memory (rx) : ORIGIN = 0x22014000, LENGTH = 12K
dtcm_memory (rx) : ORIGIN = 0x42014000, LENGTH = 8K
ram_memory (!rx) : ORIGIN = 0x42016000, LENGTH = 72K

View File

@@ -63,10 +63,10 @@
* OLED Brightness
*
*/
#define MIN_BRIGHTNESS 1 // Min OLED brightness selectable
#define MAX_BRIGHTNESS 101 // Max OLED brightness selectable
#define BRIGHTNESS_STEP 25 // OLED brightness increment
#define DEFAULT_BRIGHTNESS 26 // default OLED brightness
#define MIN_BRIGHTNESS 1 // Min OLED brightness selectable
#define MAX_BRIGHTNESS 101 // Max OLED brightness selectable
#define BRIGHTNESS_STEP 25 // OLED brightness increment
#define DEFAULT_BRIGHTNESS 26 // default OLED brightness
/**
* Temp change settings
@@ -87,7 +87,7 @@
#define POWER_PULSE_DEFAULT 0
#else
#define POWER_PULSE_DEFAULT 5
#endif /* Pinecil */
#endif /* Pinecil */
#define POWER_PULSE_WAIT_DEFAULT 4 // Default rate of the power pulse: 4*2500 = 10000 ms = 10 s
#define POWER_PULSE_DURATION_DEFAULT 1 // Default duration of the power pulse: 1*250 = 250 ms
@@ -167,8 +167,10 @@
#define CANT_DIRECT_READ_SETTINGS
#endif /* Pinecilv2 */
#define FLASH_LOGOADDR (0x23000000 + (1022 * 1024))
#define FLASH_PAGE_SIZE (1024)
#define FLASH_PAGE_SIZE (1024) // Read pages
// Erase is 4 or 8 k size, so we pad these apart for now
// If we ever get low on flash, will need better solution
#define FLASH_LOGOADDR (0x23000000 + (1016 * FLASH_PAGE_SIZE))
#define SETTINGS_START_PAGE (1023 * FLASH_PAGE_SIZE) // Hal auto offsets base addr
#endif /* CONFIGURATION_H_ */

View File

@@ -1,6 +1,7 @@
// BSP mapping functions
#include "BSP.h"
#include "BootLogo.h"
#include "HUB238.hpp"
#include "I2C_Wrapper.hpp"
#include "Pins.h"
@@ -236,4 +237,6 @@ uint8_t preStartChecksDone() { return 1; }
uint8_t getTipThermalMass() { return TIP_THERMAL_MASS; }
uint8_t getTipInertia() { return TIP_THERMAL_INERTIA; }
void setBuzzer(bool on) {}
void setBuzzer(bool on) {}
void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR); }

View File

@@ -76,8 +76,7 @@ void startGUITask(void const *argument) {
currentTempTargetDegC = min(sleepTempDegC, 75);
}
BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR);
showBootLogo();
showWarnings();
if (getSettingValue(SettingsOptions::AutoStartMode)) {
// jump directly to the autostart mode

View File

@@ -407,7 +407,8 @@ DEVICE_BSP_DIR=./Core/BSP/Pinecilv2
S_SRCS:=$(shell find $(PINECILV2_DIR) -type d \( -path $(PINECILV2_VENDOR_BSP_COMMON_DIR) \) -prune -false -o -type f -name '*.S') $(info $(S_SRCS) )
ASM_INC=$(DEVICE_INCLUDES)
LDSCRIPT=./Core/BSP/Pinecilv2/bl_mcu_sdk/drivers/bl702_driver/bl702_flash.ld
DEVICE_DFU_ADDRESS=0x23000000
# DFU starts at the beginning of flash
# Flags
CPUFLAGS=-march=rv32imafc \
-mabi=ilp32f \