-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xbee fixes #6406
Xbee fixes #6406
Conversation
@@ -13,7 +13,7 @@ BOARD_INSUFFICIENT_MEMORY := chronos msb-430 msb-430h | |||
#USEMODULE += xbee | |||
|
|||
## set default UART to use in case none was defined | |||
#XBEE_UART ?= "UART_NUMOF-1" | |||
#XBEE_UART ?= "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the idea of this change? The current version seems to be more flexible to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I find that the most common usage of XBee is on platforms which offer more than one UART, especially for Arduino boards, on which the XBee shield is attached to UART0.
Using the current approach the XBee goes to UART3 in arduino-mega2560, which is not evident to know IMHO. Additionally, on platforms with only 1 UART it goes to UART0, which is usually used for STDIO, thus conflicting since we don't have any check in the current master to avoid such conflict.
Thus, I prefer to state exactly which UART I'm going to use, and if it doesn't exists at least I'll have STDIO free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either way, this should be XBEE_UART ?= UART_DEV\(x\)
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not done in line 21?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens on Boards where UART_NUMOF == 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I mean #XBEE_UART ?= "UART_NUMOF-1"
and #XBEE_UART ?= "1"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I thought this is wrong anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what is the assertion about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what's wrong or not, I just want to have a clear definition of which UART is being used by the XBee device, for me it's somehow ambiguous this UART_NUMOF-1
, since anyways I'm quite sure to which UART I'm connecting my device.
For the assertion is in this line. Just checks if the UART_NUMOF is greater than the UART device used by the XBee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forget my comment above...
@@ -41,11 +41,11 @@ | |||
/** | |||
* @brief Delay when entering command mode, must be > 1s | |||
*/ | |||
#define ENTER_CMD_MODE_DELAY (1100U * 1000U) | |||
#define ENTER_CMD_MODE_DELAY (1100UL * SEC_IN_MS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean MS_IN_USEC
here?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops... yes, you're right, will change.
@@ -13,7 +13,7 @@ BOARD_INSUFFICIENT_MEMORY := chronos msb-430 msb-430h | |||
#USEMODULE += xbee | |||
|
|||
## set default UART to use in case none was defined | |||
#XBEE_UART ?= "UART_NUMOF-1" | |||
#XBEE_UART ?= "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either way, this should be XBEE_UART ?= UART_DEV\(x\)
...
Can I squash and let Murdock agree? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please squash
@OlegHahm are you happy, too? |
Is it on purpose to activate |
Yes, it ensures if the XBee is correctly configured on a valid UART port. |
How so? |
With the assertion I talked about above. |
The assertions just checks if the UART exist, right? So, you can still misconfigure your XBEE. I don't have a strong opinion, just found it noteworthy that most other tests don't use |
No, the assertion checks if the UART is not UART0 and if it's not higher than the number of available UARTs. I must use this solution since we don't have any other way to check misconfiguration in production-like environment. Maybe #6408 wold help. |
Yes, that's what I meant.
I don't get this. In a production environment, you would not use |
Yes I agree with you, I only want a way to make clear what the test fails, using the former approach it just fails without any apparent reason. I let you the honour to merge it. |
Rebased to include #6399 . |
@OlegHahm CI has passed. Mind to take a final look at the changes and merge in best case? |
Sure :) |
Some XBee fixes, especially to work with small platforms (e.g. AVR8)