diff --git a/Core/Inc/protocan.h b/Core/Inc/protocan.h index 99fa270..466f33c 100644 --- a/Core/Inc/protocan.h +++ b/Core/Inc/protocan.h @@ -8,9 +8,21 @@ #define ONLINE 1; #define OFFLINE 0; -#define ID_MAIN_DEVICE 0x000 +#ifndef YESNO +#define YESNO +#define YES 1 +#define NO 0 +#endif + +#define ISPM NO + +#ifndef CURRENT_TYPE_DEVICE #define CURRENT_TYPE_DEVICE 0b001 +#endif + +#ifndef CURRENT_ID_DEVICE #define CURRENT_ID_DEVICE 0b0010 +#endif #define PROTOCAN_RX_BUFFER_SIZE 128 diff --git a/Core/Src/protocan.c b/Core/Src/protocan.c index b5dcb5a..8691f2e 100644 --- a/Core/Src/protocan.c +++ b/Core/Src/protocan.c @@ -1414,9 +1414,13 @@ void PROTOCAN_FILTERS() #define BITS_20_23_MASK (0xFUL << 20) // 4 бита (20..23) #define BITS_24_26_MASK (0x7UL << 24) // 3 бита (24..26) - uint32_t filter1_id = BIT27 | (CURRENT_TYPE_DEVICE << 24) | (CURRENT_ID_DEVICE << 20); + #if ISPM == 0 + uint32_t filter1_id = 0 | (CURRENT_TYPE_DEVICE << 24) | (CURRENT_ID_DEVICE << 20); uint32_t filter1_mask = BIT27 | BITS_24_26_MASK | BITS_20_23_MASK; // все проверяемые биты - + #else + uint32_t filter1_id = BIT27; + uint32_t filter1_mask = BIT27; // все проверяемые биты + #endif #define BITS_16_19_MASK (0xFUL << 16) uint32_t filter2_id = PROTOCAN_MSGTYPE_BROADCAST << 16;