Skip to content

Commit 347ca0a

Browse files
authored
Update docs (#1428)
* Clarify that MY_HOSTNAME is only supported on ESP And remove redundant Doxygen define, that caused MY_HOSTNAME to show up twice in the documentation. * Fix double define of MY_RAM_ROUTING_TABLE_ENABLED MY_RAM_ROUTING_TABLE_ENABLED showed up twice in the docs. By reordering, the define only shows up once. I don't think DOXYGEN will be defined when anyone builds their sketches, so this change should not affect functionality. * Doxygen: Add check for multiple defines of same keyword * Fix unmatched ifdef * Add documentation for config struct for Linux gw This avoids the following doxygen warning: warning: Compound config is not documented.
1 parent 6059d84 commit 347ca0a

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

Documentation/doxygen.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
## Invoke from project root, e.g Documentation/doxygen.sh
3+
result=0
34

45
# Generate doxygen file for Raspberry Pi configure command
56
echo -e "/**\n * @defgroup RaspberryPiGateway Raspberry Pi Gateway\n * @ingroup MyConfigGrp\n * @brief Configuration options for the Raspberry Pi Gateway\n@{\n@verbatim" > configure.h
@@ -19,5 +20,17 @@ doxygen
1920
# Show any warnings created
2021
cat doxygen.log
2122

23+
# Check for defines that occur multiple times
24+
multiple_defines=$(for file in Documentation/html/*.html; do grep -e 'memname' $file | grep 'define MY_' | cut -f2 -d'#'| cut -f1 -d'<' | awk '{ print $2 }' | sort | uniq -c | grep -v '1 MY_'; done)
25+
if [ -n "$multiple_defines" ]; then
26+
echo "The following defines occur more than once:"
27+
echo $multiple_defines
28+
result=1
29+
else
30+
echo "No defines occur more than once - great!"
31+
fi
32+
2233
# Clean up autogenerated (temporary) artifacts
2334
rm configure.h
35+
36+
exit $result

MyConfig.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@
14231423

14241424
/**
14251425
* @def MY_HOSTNAME
1426-
* @brief Hostname of your device
1426+
* @brief Hostname of your device. Only supported on ESP8266 and ESP32.
14271427
*/
14281428
#ifndef MY_HOSTNAME
14291429
#define MY_HOSTNAME "MYSENSORS_DEVICE"
@@ -2352,7 +2352,6 @@
23522352
#define MY_WIFI_SSID
23532353
#define MY_WIFI_BSSID
23542354
#define MY_WIFI_PASSWORD
2355-
#define MY_HOSTNAME
23562355
#define MY_GATEWAY_LINUX
23572356
#define MY_GATEWAY_TINYGSM
23582357
#define MY_GATEWAY_MQTT_CLIENT

MySensors.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,15 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
311311
#endif
312312

313313
// RAM ROUTING TABLE
314-
#if defined(MY_RAM_ROUTING_TABLE_FEATURE) && defined(MY_REPEATER_FEATURE)
314+
#ifdef DOXYGEN
315+
/**
316+
* @def MY_RAM_ROUTING_TABLE_ENABLED
317+
* @brief Automatically set if RAM routing table is enabled
318+
*
319+
* @see MY_RAM_ROUTING_TABLE_FEATURE
320+
*/
321+
#define MY_RAM_ROUTING_TABLE_ENABLED
322+
#elif defined(MY_RAM_ROUTING_TABLE_FEATURE) && defined(MY_REPEATER_FEATURE)
315323
// activate feature based on architecture
316324
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_NRF5) || defined(ARDUINO_ARCH_STM32F1) || defined(TEENSYDUINO) || defined(__linux__)
317325
#define MY_RAM_ROUTING_TABLE_ENABLED
@@ -324,16 +332,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
324332
// #define MY_RAM_ROUTING_TABLE_ENABLED
325333
#endif // __avr_atmega1280__, __avr_atmega1284__, __avr_atmega2560__
326334
#endif // ARDUINO_ARCH_AVR
327-
#endif
328-
#ifdef DOXYGEN
329-
/**
330-
* @def MY_RAM_ROUTING_TABLE_ENABLED
331-
* @brief Automatically set if RAM routing table is enabled
332-
*
333-
* @see MY_RAM_ROUTING_TABLE_FEATURE
334-
*/
335-
#define MY_RAM_ROUTING_TABLE_ENABLED
336-
#endif
335+
#endif // DOXYGEN
337336

338337
// SOFTSERIAL
339338
#if defined(MY_GSM_TX) != defined(MY_GSM_RX)

hal/architecture/Linux/drivers/core/config.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
extern "C" {
2525
#endif
2626

27+
/**
28+
* @brief Config file
29+
*/
2730
struct config {
2831
int verbose;
2932
int log_file;
@@ -45,4 +48,4 @@ void config_cleanup(void);
4548
}
4649
#endif
4750

48-
#endif
51+
#endif

0 commit comments

Comments
 (0)