Browse Source

HAL_ChibiOS: fixed build warnings

master
Andrew Tridgell 7 years ago
parent
commit
4886ffbf8a
  1. 1
      libraries/AP_HAL_ChibiOS/hwdef/common/board.c
  2. 6
      libraries/AP_HAL_ChibiOS/hwdef/common/stdio.c
  3. 33
      libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.c
  4. 5
      libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.h
  5. 5
      libraries/AP_HAL_ChibiOS/system.cpp

1
libraries/AP_HAL_ChibiOS/hwdef/common/board.c

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
*/
#include "hal.h"
#include "usbcfg.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
/**

6
libraries/AP_HAL_ChibiOS/hwdef/common/stdio.c

@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
#include <hal.h>
#include <memstreams.h>
#include <chprintf.h>
#include "stdio.h"
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
{
@ -116,6 +117,7 @@ int printf(const char *fmt, ...) @@ -116,6 +117,7 @@ int printf(const char *fmt, ...)
int
scanf (const char *fmt, ...)
{
(void)fmt;
return 0;
}
/*
@ -170,7 +172,7 @@ _atob (uint32_t *vp, char *p, int base) @@ -170,7 +172,7 @@ _atob (uint32_t *vp, char *p, int base)
}
if (base == 16 && (q = strchr (p, '.')) != 0) {
if (q - p > sizeof(tmp) - 1)
if ((unsigned)(q - p) > (unsigned)(sizeof(tmp) - 1))
return (0);
strncpy (tmp, p, q - p);
@ -227,7 +229,7 @@ atob(uint32_t *vp, char *p, int base) @@ -227,7 +229,7 @@ atob(uint32_t *vp, char *p, int base)
}
#if HAL_OS_FATFS_IO
#if defined(HAL_OS_FATFS_IO) && HAL_OS_FATFS_IO
/*
* vsscanf(buf,fmt,ap)
*/

33
libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.c

@ -167,39 +167,6 @@ static const uint8_t vcom_string0[] = { @@ -167,39 +167,6 @@ static const uint8_t vcom_string0[] = {
USB_DESC_WORD(0x0409) /* wLANGID (U.S. English). */
};
/*
* Vendor string.
*/
static const uint8_t vcom_string1[] = {
USB_DESC_BYTE(20), /* bLength. */
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
'A', 0, 'r', 0, 'd', 0, 'u', 0, 'P', 0, 'i', 0, 'l', 0, 'o', 0,
't', 0
};
/*
* Device Description string.
*/
static const uint8_t vcom_string2[] = {
USB_DESC_BYTE(56), /* bLength. */
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
'C', 0, 'h', 0, 'i', 0, 'b', 0, 'i', 0, 'O', 0, 'S', 0, '/', 0,
'R', 0, 'T', 0, ' ', 0, 'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0,
'a', 0, 'l', 0, ' ', 0, 'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0,
'o', 0, 'r', 0, 't', 0
};
/*
* Serial Number string.
*/
static const uint8_t vcom_string3[] = {
USB_DESC_BYTE(8), /* bLength. */
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
'0' + CH_KERNEL_MAJOR, 0,
'0' + CH_KERNEL_MINOR, 0,
'0' + CH_KERNEL_PATCH, 0
};
/*
* Strings wrappers array. The strings are created dynamically to
* allow them to be setup with apj_tool

5
libraries/AP_HAL_ChibiOS/hwdef/common/usbcfg.h

@ -33,4 +33,7 @@ extern const USBConfig usbcfg; @@ -33,4 +33,7 @@ extern const USBConfig usbcfg;
extern SerialUSBConfig serusbcfg;
extern SerialUSBDriver SDU1;
#endif
/** @} */
void setup_usb_strings(void);
/** @} */

5
libraries/AP_HAL_ChibiOS/system.cpp

@ -38,10 +38,13 @@ typedef enum { @@ -38,10 +38,13 @@ typedef enum {
void *__dso_handle;
void __cxa_pure_virtual(void);
void __cxa_pure_virtual() { while (1); } //TODO: Handle properly, maybe generate a traceback
void NMI_Handler(void);
void NMI_Handler(void) { while (1); }
void HardFault_Handler(void);
void HardFault_Handler(void) {
//Copy to local variables (not pointers) to allow GDB "i loc" to directly show the info
//Get thread context. Contains main registers including PC and LR
@ -72,6 +75,7 @@ void HardFault_Handler(void) { @@ -72,6 +75,7 @@ void HardFault_Handler(void) {
void BusFault_Handler(void) __attribute__((alias("HardFault_Handler")));
void UsageFault_Handler(void);
void UsageFault_Handler(void) {
//Copy to local variables (not pointers) to allow GDB "i loc" to directly show the info
//Get thread context. Contains main registers including PC and LR
@ -99,6 +103,7 @@ void UsageFault_Handler(void) { @@ -99,6 +103,7 @@ void UsageFault_Handler(void) {
while(1) {}
}
void MemManage_Handler(void);
void MemManage_Handler(void) {
//Copy to local variables (not pointers) to allow GDB "i loc" to directly show the info
//Get thread context. Contains main registers including PC and LR

Loading…
Cancel
Save