#include "config_defaults.h"

#include <string.h>

void Config_LoadDefaults(BridgeConfig_t *cfg)
{
    if (cfg == 0)
    {
        return;
    }
    cfg->rf_frequency = DEFAULT_RF_FREQUENCY;
    cfg->tx_power = DEFAULT_TX_OUTPUT_POWER;
    cfg->fsk_bitrate = DEFAULT_FSK_BITRATE;
    cfg->fsk_bandwidth = DEFAULT_FSK_BANDWIDTH;
    cfg->fsk_fdev = DEFAULT_FSK_FDEV;
    cfg->fsk_preamble_len = DEFAULT_FSK_PREAMBLE_LENGTH;
    static const uint8_t default_syncword[3] = DEFAULT_SYNCWORD;
    memcpy(cfg->syncword, default_syncword, sizeof(cfg->syncword));
    cfg->uart_packet_timeout_ms = DEFAULT_UART_PACKET_TIMEOUT_MS;
    cfg->uart_baudrate = DEFAULT_UART_BAUDRATE;
}