From 6bd020e848a99369c3fadae9c7cc25d8d5086d7d Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 7 Sep 2022 17:47:50 +1200 Subject: [PATCH] platforms: decrease flash usage by type for bus id My assumption is that the bus are numbered < 127. This saves about 100 bytes of flash. --- platforms/common/include/px4_platform_common/spi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/common/include/px4_platform_common/spi.h b/platforms/common/include/px4_platform_common/spi.h index b9e56bb900..6664409822 100644 --- a/platforms/common/include/px4_platform_common/spi.h +++ b/platforms/common/include/px4_platform_common/spi.h @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2020 PX4 Development Team. All rights reserved. + * Copyright (c) 2020-2022 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -64,8 +64,8 @@ struct px4_spi_bus_devices_t { struct px4_spi_bus_t { px4_spi_bus_device_t devices[SPI_BUS_MAX_DEVICES]; - int bus{-1}; ///< physical bus number (1, ...) (-1 means this is unused) uint32_t power_enable_gpio{0}; ///< GPIO (if non-zero) to control the power of the attached devices on this bus (0 means power is off) + int8_t bus{-1}; ///< physical bus number (1, ...) (-1 means this is unused) bool is_external; ///< static external configuration. Use px4_spi_bus_external() to check if a bus is really external bool requires_locking; ///< whether the bus should be locked during transfers (true if NuttX drivers access the bus) };