diff --git a/Src/InputStream.c b/Src/InputStream.c index 1539841..5daf91f 100644 --- a/Src/InputStream.c +++ b/Src/InputStream.c @@ -1,6 +1,16 @@ #include "InputStream.h" #include +#if ISTREAM + +#if !STREAM_READ + #error "For using InputStream Library you must enable STREAM_READ in StreamBuffer.h" +#endif + +#if !STREAM_PENDING_BYTES + #error "For using InputStream Library you must enable STREAM_PENDING_BYTES in StreamBuffer.h" +#endif + /** * @brief Initialize InputStream * @@ -118,3 +128,5 @@ void IStream_onFull(IStream* stream, IStream_OnFullFn fn) { stream->onFull = fn; } #endif + +#endif // ISTREAM diff --git a/Src/InputStream.h b/Src/InputStream.h index 523ee22..e31fa86 100644 --- a/Src/InputStream.h +++ b/Src/InputStream.h @@ -24,7 +24,10 @@ extern "C" { /************************************************************************/ /* Configuration */ /************************************************************************/ - +/** + * @brief This lable shows OStream Libraty is enabled or not + */ +#define ISTREAM (1 && STREAM_READ && STREAM_PENDING_BYTES) /** * @brief enable checkTransmit function */ @@ -37,19 +40,6 @@ extern "C" { /************************************************************************/ -#if !STREAM_READ - #error "For using InputStream Library you must enable STREAM_READ in StreamBuffer.h" -#endif - -#if !STREAM_PENDING_BYTES - #error "For using InputStream Library you must enable STREAM_PENDING_BYTES in StreamBuffer.h" -#endif - -/** - * @brief This lable shows OStream Libraty is enabled or not - */ -#define ISTREAM (STREAM_READ && STREAM_PENDING_BYTES) - /** * @brief show stream version in string format */