/* Link-time stubs for the KE0WPC beacon firmware.
 *
 * The beacon links the stock UV-K5 driver files completely unmodified, so
 * that this project can be rebased onto a newer upstream by copying the
 * beacon/ directory across and nothing else. A few of those drivers refer
 * to globals that normally live in the full radio application, which the
 * beacon does not build. Rather than fork the drivers, we satisfy those
 * references here.
 *
 * Apache License, Version 2.0.
 */

#include <stdbool.h>
#include <stdint.h>

/* ------------------------------------------------------------------ */
/* Display settings referenced by driver/st7565.c                      */
/* ------------------------------------------------------------------ */

/* In the full firmware these are user menu items. The beacon fixes them:
 * normal (non-inverted) video at the stock contrast setting. */
uint8_t gSetting_set_ctr = 10;   /* 0..15, 10 is the stock default */
bool    gSetting_set_inv = false;

/* ------------------------------------------------------------------ */
/* BOARD_FLASH_Init                                                    */
/* ------------------------------------------------------------------ */

/* start.S calls this unconditionally out of HandlerReset. In the stock
 * firmware it only has a body when the SRAM overlay feature is compiled
 * in, where it retimes the flash and reconfigures the system clocks.
 *
 * The beacon is a non-overlay build, so the correct behaviour here is to
 * do nothing and leave the clock tree exactly as the bootloader set it up.
 * That matters: driver/systick.c assumes a 48 MHz core clock when it
 * computes its microsecond multiplier, and the CW element timing is
 * derived from that. Do not be tempted to call SYSTEM_ConfigureClocks()
 * here - it would halve the core clock and stretch every dit and dah. */
void BOARD_FLASH_Init(void);
void BOARD_FLASH_Init(void)
{
}
