More header cleanup

This commit is contained in:
Uwe Bonnes 2021-05-14 22:25:39 +02:00 committed by UweBonnes
parent 8e438b9e5f
commit e4421799ba
21 changed files with 19 additions and 41 deletions

View File

@ -41,7 +41,6 @@
#include <libopencm3/usb/cdc.h> #include <libopencm3/usb/cdc.h>
#include <libopencm3/cm3/scb.h> #include <libopencm3/cm3/scb.h>
#include <libopencm3/usb/dfu.h> #include <libopencm3/usb/dfu.h>
#include <stdlib.h>
#define DFU_IF_NO 4 #define DFU_IF_NO 4

View File

@ -22,7 +22,6 @@
#include "general.h" #include "general.h"
#include "gdb_if.h" #include "gdb_if.h"
#include "version.h" #include "version.h"
#include "platform.h"
#include "remote.h" #include "remote.h"
#include "target.h" #include "target.h"
#include "bmp_remote.h" #include "bmp_remote.h"
@ -33,7 +32,6 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/time.h> #include <sys/time.h>
#include <errno.h> #include <errno.h>
#include <string.h>
#include "adiv5.h" #include "adiv5.h"

View File

@ -19,11 +19,9 @@
/* Find all known serial connected debuggers */ /* Find all known serial connected debuggers */
#include "general.h"
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include "general.h"
#include "platform.h"
#include "bmp_hosted.h" #include "bmp_hosted.h"
#include "version.h" #include "version.h"

View File

@ -47,7 +47,7 @@ int cmsis_dap_jtagtap_init(jtag_proc_t *jtag_proc) {return -1;}
int dap_swdptap_init(swd_proc_t *swd_proc) {return -1;} int dap_swdptap_init(swd_proc_t *swd_proc) {return -1;}
int dap_jtag_dp_init(ADIv5_DP_t *dp) {return -1;} int dap_jtag_dp_init(ADIv5_DP_t *dp) {return -1;}
void dap_swd_configure(uint8_t cfg) {}; void dap_swd_configure(uint8_t cfg) {};
## pragma GCC diagnostic pop # pragma GCC diagnostic pop
#endif #endif

View File

@ -32,7 +32,6 @@
/*- Includes ----------------------------------------------------------------*/ /*- Includes ----------------------------------------------------------------*/
#include <general.h> #include <general.h>
#include <stdlib.h>
#include "dap.h" #include "dap.h"
#include "jtag_scan.h" #include "jtag_scan.h"

View File

@ -20,7 +20,6 @@
*/ */
#include "general.h" #include "general.h"
#include "gdb_if.h" #include "gdb_if.h"
#include "platform.h"
#include "target.h" #include "target.h"
#include <assert.h> #include <assert.h>

View File

@ -21,13 +21,10 @@
* *
*/ */
#include <stdio.h> #include "general.h"
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include <alloca.h>
#include <assert.h> #include <assert.h>
#include "general.h"
#include "exception.h" #include "exception.h"
#include "jlink.h" #include "jlink.h"

View File

@ -22,15 +22,12 @@
* *
*/ */
#include <stdio.h> #include "general.h"
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include <assert.h> #include <assert.h>
#include <ftdi.h> #include <ftdi.h>
#include "platform.h"
#include "ftdi_bmp.h" #include "ftdi_bmp.h"
#include "general.h"
extern cable_desc_t *active_cable; extern cable_desc_t *active_cable;
extern struct ftdi_context *ftdic; extern struct ftdi_context *ftdic;

View File

@ -21,12 +21,10 @@
* Speed is sensible. * Speed is sensible.
*/ */
#include <stdio.h> #include "general.h"
#include <assert.h> #include <assert.h>
#include "general.h"
#include <ftdi.h> #include <ftdi.h>
#include "platform.h"
#include "ftdi_bmp.h" #include "ftdi_bmp.h"
enum swdio_status{ enum swdio_status{

View File

@ -26,13 +26,11 @@
* Should share interface with swdptap.c or at least clean up... * Should share interface with swdptap.c or at least clean up...
*/ */
#include <stdio.h> #include "general.h"
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include <assert.h> #include <assert.h>
#include "general.h"
#include "remote.h" #include "remote.h"
#include "jtagtap.h" #include "jtagtap.h"
#include "bmp_remote.h" #include "bmp_remote.h"

View File

@ -24,12 +24,10 @@
#include "general.h" #include "general.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "version.h" #include "version.h"
#include "target.h"
#include "target_internal.h" #include "target_internal.h"
#include "cortexm.h" #include "cortexm.h"
#include "command.h" #include "command.h"

View File

@ -36,13 +36,11 @@
# include <fcntl.h> # include <fcntl.h>
#endif #endif
#include <stdio.h> #include "general.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "general.h"
#include "gdb_if.h" #include "gdb_if.h"
static int gdb_if_serv, gdb_if_conn; static int gdb_if_serv, gdb_if_conn;

View File

@ -61,9 +61,7 @@ extern "C" {
} /* extern "C" */ } /* extern "C" */
#endif #endif
#include <stdio.h> #include <general.h>
#include <stdlib.h>
#include "hidapi.h" #include "hidapi.h"

View File

@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <sys/types.h> #include "general.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/select.h> #include <sys/select.h>
#include <dirent.h> #include <dirent.h>
@ -25,9 +25,7 @@
#include <errno.h> #include <errno.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include "general.h"
#include "remote.h" #include "remote.h"
#include "cl_utils.h" #include "cl_utils.h"
#include "cortexm.h" #include "cortexm.h"
@ -61,8 +59,9 @@ static int set_interface_attribs(void)
tty.c_cflag |= (CLOCAL | CREAD);// ignore modem controls, tty.c_cflag |= (CLOCAL | CREAD);// ignore modem controls,
// enable reading // enable reading
tty.c_cflag &= ~CSTOPB; tty.c_cflag &= ~CSTOPB;
#if defined(CRTSCTS)
tty.c_cflag &= ~CRTSCTS; tty.c_cflag &= ~CRTSCTS;
#endif
if (tcsetattr (fd, TCSANOW, &tty) != 0) { if (tcsetattr (fd, TCSANOW, &tty) != 0) {
DEBUG_WARN("error %d from tcsetattr", errno); DEBUG_WARN("error %d from tcsetattr", errno);
return -1; return -1;

View File

@ -17,7 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <sys/types.h>
#include "general.h" #include "general.h"
#include <windows.h> #include <windows.h>
#include "remote.h" #include "remote.h"

View File

@ -44,7 +44,14 @@ int vasprintf(char **strp, const char *fmt, va_list ap)
void platform_delay(uint32_t ms) void platform_delay(uint32_t ms)
{ {
usleep(ms * 1000); #if defined(_WIN32) && !defined(__MINGW32__)
Sleep(ms);
#else
# if !defined(usleep)
int usleep(unsigned int);
# endif
usleep(ms);
#endif
} }
uint32_t platform_time_ms(void) uint32_t platform_time_ms(void)

View File

@ -24,7 +24,6 @@
#include "gdb_packet.h" #include "gdb_packet.h"
#include "jtagtap.h" #include "jtagtap.h"
#include "gdb_if.h" #include "gdb_if.h"
#include "platform.h"
#include "version.h" #include "version.h"
#include "exception.h" #include "exception.h"
#include <stdarg.h> #include <stdarg.h>

View File

@ -33,7 +33,6 @@
#include "target.h" #include "target.h"
#include "target_internal.h" #include "target_internal.h"
#include "cortexm.h" #include "cortexm.h"
#include "platform.h"
#include "command.h" #include "command.h"
#include "gdb_packet.h" #include "gdb_packet.h"

View File

@ -19,7 +19,6 @@
*/ */
#include "general.h" #include "general.h"
#include "target.h"
#include "target_internal.h" #include "target_internal.h"
#include <stdarg.h> #include <stdarg.h>
@ -342,7 +341,6 @@ void target_detach(target *t)
t->detach(t); t->detach(t);
t->attached = false; t->attached = false;
#if PC_HOSTED == 1 #if PC_HOSTED == 1
# include "platform.h"
platform_buffer_flush(); platform_buffer_flush();
#endif #endif
} }