LIBFTDI: Propagate the command line arguments to platform_init
This commit is contained in:
parent
73d120577b
commit
ce059cc8ed
|
@ -21,10 +21,12 @@
|
|||
#ifndef __GDB_IF_H
|
||||
#define __GDB_IF_H
|
||||
|
||||
#if !defined(LIBFTDI)
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
void gdb_usb_out_cb(usbd_device *dev, uint8_t ep);
|
||||
#endif
|
||||
|
||||
int gdb_if_init(void);
|
||||
void gdb_usb_out_cb(usbd_device *dev, uint8_t ep);
|
||||
unsigned char gdb_if_getchar(void);
|
||||
unsigned char gdb_if_getchar_to(int timeout);
|
||||
void gdb_if_putchar(unsigned char c, int flush);
|
||||
|
|
|
@ -34,10 +34,15 @@
|
|||
#include "target.h"
|
||||
|
||||
int
|
||||
main(void)
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
#if defined(LIBFTDI)
|
||||
assert(platform_init(argc, argv) == 0);
|
||||
#else
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
assert(platform_init() == 0);
|
||||
|
||||
#endif
|
||||
PLATFORM_SET_FATAL_ERROR_RECOVERY();
|
||||
|
||||
gdb_main();
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
CFLAGS += -DLIBFTDI
|
||||
LDFLAGS += -lftdi -lusb
|
||||
|
|
|
@ -32,7 +32,7 @@ struct ftdi_context *ftdic;
|
|||
static uint8_t outbuf[BUF_SIZE];
|
||||
static uint16_t bufptr = 0;
|
||||
|
||||
int platform_init(void)
|
||||
int platform_init(int argc, char **argv)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
|
@ -40,12 +40,12 @@
|
|||
#define PLATFORM_FATAL_ERROR(error) abort()
|
||||
#define PLATFORM_SET_FATAL_ERROR_RECOVERY()
|
||||
|
||||
#define morse(x, y) do {} while(0)
|
||||
#define morse(x, y) fprintf(stderr,"%s\n", x)
|
||||
#define morse_msg 0
|
||||
|
||||
extern struct ftdi_context *ftdic;
|
||||
|
||||
int platform_init(void);
|
||||
int platform_init(int argc, char **argv);
|
||||
const char *platform_target_voltage(void);
|
||||
void platform_delay(uint32_t delay);
|
||||
|
||||
|
|
Loading…
Reference in New Issue