Split I2C + startup logo
This commit is contained in:
@@ -41,6 +41,10 @@ void unstick_I2C();
|
||||
|
||||
//Reboot the IC when things go seriously wrong
|
||||
void reboot();
|
||||
|
||||
//If the user has programmed in a bootup logo, draw it to the screen from flash
|
||||
//Returns 1 if the logo was printed so that the unit waits for the timeout or button
|
||||
uint8_t showBootLogoIfavailable();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
27
workspace/TS100/Core/BSP/Miniware/logo.cpp
Normal file
27
workspace/TS100/Core/BSP/Miniware/logo.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* logo.c
|
||||
*
|
||||
* Created on: 29 May 2020
|
||||
* Author: Ralim
|
||||
*/
|
||||
|
||||
#include "BSP.h"
|
||||
#include "OLED.hpp"
|
||||
// Second last page of flash set aside for logo image.
|
||||
#define FLASH_LOGOADDR (0x8000000 | 0xF800)
|
||||
|
||||
// Logo header signature.
|
||||
#define LOGO_HEADER_VALUE 0xF00DAA55
|
||||
|
||||
uint8_t showBootLogoIfavailable() {
|
||||
// Do not show logo data if signature is not found.
|
||||
if (LOGO_HEADER_VALUE
|
||||
!= *(reinterpret_cast<const uint32_t*>(FLASH_LOGOADDR))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
OLED::drawAreaSwapped(0, 0, 96, 16, (uint8_t*) (FLASH_LOGOADDR + 4));
|
||||
OLED::refresh();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
#include "BSP.h"
|
||||
#include "Setup.h"
|
||||
#include "Pins.h"
|
||||
#include "FRTosI2C.hpp"
|
||||
void preRToSInit() {
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick.
|
||||
*/
|
||||
HAL_Init();
|
||||
Setup_HAL(); // Setup all the HAL objects
|
||||
FRToSI2C::init(&hi2c1);
|
||||
HAL_Delay(50);
|
||||
HAL_GPIO_WritePin(OLED_RESET_GPIO_Port, OLED_RESET_Pin, GPIO_PIN_SET);
|
||||
HAL_Delay(50);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user