1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/pcf857x: Move compile time check to compilation unit

This allows including the header without using the module. Obviously,
calls to the functions provided by the header won't like without using
the module. But including the header can still be useful for e.g.:

    if (IS_USED(MODULE_PCF857x)) {
        /* make use of the module */
    }

In the above example all calls to pcf857x functions would be optimized
out when the module is not used, full compile checks happen in either
case.
This commit is contained in:
Marian Buschsieweke 2023-06-27 19:16:05 +02:00
parent 7336d9c10a
commit d0fccdb549
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94
2 changed files with 4 additions and 4 deletions

View File

@ -260,10 +260,6 @@ extern "C"
#include "event.h"
#endif /* MODULE_PCF857X_IRQ */
#if !IS_USED(MODULE_PCF8574) && !IS_USED(MODULE_PCF8574A) && !IS_USED(MODULE_PCF8575)
#error "Please provide a list of pcf857x variants used by the application (pcf8574, pcf8574a or pcf8575)"
#endif
/**
* @name PCF857X I2C slave addresses
*

View File

@ -42,6 +42,10 @@
#endif /* ENABLE_DEBUG */
#if !IS_USED(MODULE_PCF8574) && !IS_USED(MODULE_PCF8574A) && !IS_USED(MODULE_PCF8575)
#error "Please provide a list of pcf857x variants used by the application (pcf8574, pcf8574a or pcf8575)"
#endif
#if IS_USED(MODULE_PCF857X_IRQ_LOW)
#define PCF857X_EVENT_PRIO EVENT_PRIO_LOWEST
#elif IS_USED(MODULE_PCF857X_IRQ_MEDIUM)