Fix missing 'platform.h' includes in compilation units, and make them stay away.

This commit is contained in:
mikeller 2019-02-23 17:47:48 +13:00
parent 44a1dca99c
commit fad7ee3464
40 changed files with 104 additions and 9 deletions

View File

@ -69,6 +69,7 @@ elif [ $GOAL ] ; then
if [ "test" == "$GOAL" ] ; then if [ "test" == "$GOAL" ] ; then
$MAKE check-target-independence || exit $? $MAKE check-target-independence || exit $?
$MAKE check-fastram-usage-correctness || exit $? $MAKE check-fastram-usage-correctness || exit $?
$MAKE check-platform-included || exit $?
fi fi
$MAKE $GOAL || exit $? $MAKE $GOAL || exit $?

View File

@ -572,7 +572,15 @@ check-fastram-usage-correctness:
echo "Trivially initialized FAST_RAM variables found, use FAST_RAM_ZERO_INIT instead to save FLASH:"; \ echo "Trivially initialized FAST_RAM variables found, use FAST_RAM_ZERO_INIT instead to save FLASH:"; \
echo "$${TRIVIALLY_INITIALIZED}\n$${EXPLICITLY_TRIVIALLY_INITIALIZED}"; \ echo "$${TRIVIALLY_INITIALIZED}\n$${EXPLICITLY_TRIVIALLY_INITIALIZED}"; \
exit 1; \ exit 1; \
fi; fi
check-platform-included:
$(V1) PLATFORM_NOT_INCLUDED=$$(find src/main -type d -name target -prune -o -type f -name \*.c -exec grep -L "^#include \"platform.h\"" {} \;); \
if [ "$$(echo $${PLATFORM_NOT_INCLUDED} | grep -v -e '^$$' | wc -l)" -ne 0 ]; then \
echo "The following compilation units do not include the required target specific configuration provided by 'platform.h':"; \
echo "$${PLATFORM_NOT_INCLUDED}"; \
exit 1; \
fi
# rebuild everything when makefile changes # rebuild everything when makefile changes
$(TARGET_OBJS): Makefile $(TARGET_DIR)/target.mk $(wildcard make/*) $(TARGET_OBJS): Makefile $(TARGET_DIR)/target.mk $(wildcard make/*)

View File

@ -20,6 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include "platform.h"
#include "atomic.h" #include "atomic.h"
#if defined(UNIT_TEST) #if defined(UNIT_TEST)

View File

@ -18,8 +18,9 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "stdint.h" #include <stdint.h>
#include "platform.h"
#include "debug.h" #include "debug.h"

View File

@ -18,6 +18,8 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "platform.h"
#include "version.h" #include "version.h"
const char * const targetName = __TARGET__; const char * const targetName = __TARGET__;

View File

@ -22,6 +22,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include "platform.h"
#include "bitarray.h" #include "bitarray.h"
#define BITARRAY_BIT_OP(array, bit, op) ((array)[(bit) / (sizeof((array)[0]) * 8)] op (1 << ((bit) % (sizeof((array)[0]) * 8)))) #define BITARRAY_BIT_OP(array, bit, op) ((array)[(bit) / (sizeof((array)[0]) * 8)] op (1 << ((bit) % (sizeof((array)[0]) * 8))))

View File

@ -18,7 +18,9 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "stdint.h" #include <stdint.h>
#include "platform.h"
#include "color.h" #include "color.h"
#include "colorconversion.h" #include "colorconversion.h"

View File

@ -20,6 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include "platform.h"
#include "streambuf.h" #include "streambuf.h"

View File

@ -18,6 +18,8 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "platform.h"
#include "encoding.h" #include "encoding.h"
/** /**

View File

@ -30,6 +30,8 @@ Stripped down for BF use
#include <math.h> #include <math.h>
#include <stdint.h> #include <stdint.h>
#include "platform.h"
/* Workaround a lack of optimization in gcc */ /* Workaround a lack of optimization in gcc */
float exp_cst1 = 2139095040.f; float exp_cst1 = 2139095040.f;
float exp_cst2 = 0.f; float exp_cst2 = 0.f;

View File

@ -20,6 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include "platform.h"
#include "huffman.h" #include "huffman.h"
/* /*

View File

@ -21,6 +21,8 @@
#include <stdint.h> #include <stdint.h>
#include <math.h> #include <math.h>
#include "platform.h"
#include "axis.h" #include "axis.h"
#include "maths.h" #include "maths.h"

View File

@ -21,6 +21,8 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include "platform.h"
#include "streambuf.h" #include "streambuf.h"
sbuf_t *sbufInit(sbuf_t *sbuf, uint8_t *ptr, uint8_t *end) sbuf_t *sbufInit(sbuf_t *sbuf, uint8_t *ptr, uint8_t *end)

View File

@ -22,6 +22,8 @@
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include "platform.h"
#include "typeconversion.h" #include "typeconversion.h"
int isalnum(int c) int isalnum(int c)

View File

@ -23,6 +23,8 @@
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include "platform.h"
#include "common/utils.h" #include "common/utils.h"
#define _STRTO_ENDPTR 1 #define _STRTO_ENDPTR 1

View File

@ -26,6 +26,8 @@
#include <stdint.h> #include <stdint.h>
#include "platform.h"
#include "common/maths.h" #include "common/maths.h"
#include "common/printf.h" #include "common/printf.h"
#include "common/time.h" #include "common/time.h"

View File

@ -21,6 +21,9 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "platform.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "maths.h" #include "maths.h"

View File

@ -17,7 +17,9 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <platform.h>
#include "platform.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/debug.h" #include "build/debug.h"
#include "barometer.h" #include "barometer.h"

View File

@ -20,6 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include "platform.h"
#include "buf_writer.h" #include "buf_writer.h"
bufWriter_t *bufWriterInit(uint8_t *b, int total_size, bufWrite_t writer, void *arg) bufWriter_t *bufWriterInit(uint8_t *b, int total_size, bufWrite_t writer, void *arg)

View File

@ -18,6 +18,8 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "platform.h"
#include "resource.h" #include "resource.h"
const char * const ownerNames[OWNER_TOTAL_COUNT] = { const char * const ownerNames[OWNER_TOTAL_COUNT] = {

View File

@ -20,6 +20,8 @@
#include <stdint.h> #include <stdint.h>
#include "platform.h"
#include "sdcard_standard.h" #include "sdcard_standard.h"
#include "common/maths.h" #include "common/maths.h"

View File

@ -18,8 +18,11 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "platform.h"
#include "drivers/io.h" #include "drivers/io.h"
#include "timer.h" #include "timer.h"
#ifdef USE_TIMER_MGMT #ifdef USE_TIMER_MGMT
#include "pg/timerio.h" #include "pg/timerio.h"
#endif #endif

View File

@ -24,6 +24,8 @@
#include <math.h> #include <math.h>
#include <limits.h> #include <limits.h>
#include "platform.h"
#include "build/debug.h" #include "build/debug.h"
#include "common/maths.h" #include "common/maths.h"

View File

@ -20,6 +20,8 @@
#include <ctype.h> #include <ctype.h>
#include "platform.h"
#include "fat_standard.h" #include "fat_standard.h"
bool fat16_isEndOfChainMarker(uint16_t clusterNumber) bool fat16_isEndOfChainMarker(uint16_t clusterNumber)

View File

@ -36,6 +36,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include "platform.h"
#include "drivers/flash.h" #include "drivers/flash.h"
#include "io/flashfs.h" #include "io/flashfs.h"

View File

@ -22,6 +22,8 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include "platform.h"
#include "common/crc.h" #include "common/crc.h"
#include "common/maths.h" #include "common/maths.h"
#include "common/streambuf.h" #include "common/streambuf.h"

View File

@ -28,6 +28,8 @@
* SOFTWARE. * SOFTWARE.
*/ */
#include "platform.h"
#include "common/utils.h" #include "common/utils.h"
#include "emfat.h" #include "emfat.h"

View File

@ -18,6 +18,8 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "platform.h"
#include "pg/pg_ids.h" #include "pg/pg_ids.h"
#include "pg/rcdevice.h" #include "pg/rcdevice.h"
@ -27,4 +29,4 @@ void pgResetFn_rcdeviceConfig(rcdeviceConfig_t *rcdeviceConfig)
{ {
rcdeviceConfig->initDeviceAttempts = 6; rcdeviceConfig->initDeviceAttempts = 6;
rcdeviceConfig->initDeviceAttemptInterval = 1000; rcdeviceConfig->initDeviceAttemptInterval = 1000;
} }

View File

@ -99,6 +99,8 @@
* @{ * @{
*/ */
#include "platform.h"
#include "stm32f30x.h" #include "stm32f30x.h"
uint32_t hse_value = HSE_VALUE; uint32_t hse_value = HSE_VALUE;

View File

@ -28,6 +28,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "hw_config.h" #include "hw_config.h"
#include "stm32_it.h" #include "stm32_it.h"
#include "usb_lib.h" #include "usb_lib.h"

View File

@ -26,6 +26,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "usb_lib.h" #include "usb_lib.h"
#include "usb_desc.h" #include "usb_desc.h"

View File

@ -26,6 +26,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "usb_lib.h" #include "usb_lib.h"
#include "usb_desc.h" #include "usb_desc.h"
#include "usb_mem.h" #include "usb_mem.h"

View File

@ -26,6 +26,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "usb_lib.h" #include "usb_lib.h"
#include "usb_prop.h" #include "usb_prop.h"
#include "usb_pwr.h" #include "usb_pwr.h"

View File

@ -26,6 +26,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "usb_lib.h" #include "usb_lib.h"
#include "usb_conf.h" #include "usb_conf.h"
#include "usb_prop.h" #include "usb_prop.h"

View File

@ -26,6 +26,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "usb_lib.h" #include "usb_lib.h"
#include "usb_conf.h" #include "usb_conf.h"
#include "usb_pwr.h" #include "usb_pwr.h"

View File

@ -46,6 +46,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "drivers/serial_usb_vcp.h" #include "drivers/serial_usb_vcp.h"
#include "drivers/time.h" #include "drivers/time.h"

View File

@ -18,6 +18,8 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "platform.h"
#include "stm32f4xx_it.h" #include "stm32f4xx_it.h"
#include "stm32f4xx_conf.h" #include "stm32f4xx_conf.h"

View File

@ -21,6 +21,9 @@
*/ */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "usb_bsp.h" #include "usb_bsp.h"
#include "usbd_conf.h" #include "usbd_conf.h"
#include "stm32f4xx_conf.h" #include "stm32f4xx_conf.h"

View File

@ -19,16 +19,19 @@
****************************************************************************** ******************************************************************************
*/ */
#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
#pragma data_alignment = 4
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "platform.h"
#include "usbd_cdc_vcp.h" #include "usbd_cdc_vcp.h"
#include "stm32f4xx_conf.h" #include "stm32f4xx_conf.h"
#include "stdbool.h" #include "stdbool.h"
#include "drivers/time.h" #include "drivers/time.h"
#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
#pragma data_alignment = 4
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
__ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END; __ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END;
LINE_CODING g_lc; LINE_CODING g_lc;

View File

@ -19,6 +19,8 @@
****************************************************************************** ******************************************************************************
*/ */
#include "platform.h"
#include "usbd_usr.h" #include "usbd_usr.h"
#include "usbd_ioreq.h" #include "usbd_ioreq.h"