mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-17 13:48:32 +03:00
the curent local copies of libosmocore headers + source is a temporary hack anyway. We should instead rely on a system-wide install of libosmocore cross-compiled for arm-none-eabi. But leave that as a second (later) step beyond this patch. Change-Id: Ia63fd842d45a2b404233b4326050e7eda0604cf0
52 lines
1000 B
C
52 lines
1000 B
C
/* SIMtrace specific application code */
|
|
/* (C) 2017 by Harald Welte <laforge@gnumonks.org> */
|
|
|
|
#include "board.h"
|
|
#include "simtrace.h"
|
|
#include "utils.h"
|
|
#include "sim_switch.h"
|
|
#include <osmocom/core/timer.h>
|
|
#include "usb_buf.h"
|
|
|
|
void board_exec_dbg_cmd(int ch)
|
|
{
|
|
switch (ch) {
|
|
case '?':
|
|
printf("\t?\thelp\n\r");
|
|
printf("\tR\treset SAM3\n\r");
|
|
break;
|
|
case 'R':
|
|
printf("Asking NVIC to reset us\n\r");
|
|
USBD_Disconnect();
|
|
NVIC_SystemReset();
|
|
break;
|
|
default:
|
|
printf("Unknown command '%c'\n\r", ch);
|
|
break;
|
|
}
|
|
}
|
|
|
|
void board_main_top(void)
|
|
{
|
|
#ifndef APPLICATION_dfu
|
|
usb_buf_init();
|
|
|
|
/* Initialize checking for card insert/remove events */
|
|
//card_present_init();
|
|
#endif
|
|
}
|
|
|
|
int board_override_enter_dfu(void)
|
|
{
|
|
const Pin bl_sw_pin = PIN_BOOTLOADER_SW;
|
|
|
|
PIO_Configure(&bl_sw_pin, 1);
|
|
|
|
/* Enter DFU bootloader in case the respective button is pressed */
|
|
if (PIO_Get(&bl_sw_pin) == 0) {
|
|
printf("BOOTLOADER switch presssed -> Force DFU\n\r");
|
|
return 1;
|
|
} else
|
|
return 0;
|
|
}
|