-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Non-bus-powered MSP430 support. #2134
Non-bus-powered MSP430 support. #2134
Conversation
It looks fine to me (I think at the time, I only focused on bus-powered applications b/c I found it difficult to reliably put the MSP-EXP430F5529LP into self-powered mode. I do have a few questions:
|
|
Ack re: the errata; when I did this port originally, I don't recall looking at the errata. That's fine then (incl. your upcoming changes).
Ahhh I didn't know FreeRTOS ran on MSP430, tbh :D! I want to wait and hear what @hathach has to say re: "using |
@hathach I see that the non-os builds are failing on |
@clhenry Just to be clear, @hathach may be very busy, and while I am a collaborator, I mostly focus on backend stuff. I want to wait for @hathach to be less busy so he can give guidance on "sometimes no OS needs a delay" problem. You're already expected to instantiate an interrupt handler yourself and place a call into |
sorry, I was a bit busy atm, will check this out whenever I could. Thank you for your patient. |
5d403dd
to
5d3b089
Compare
tinyusb tries not to use additional hardware timer, and does not requires an time keeping function from application. For any short delay without rtos, it should use actual |
TU_ATTR_ALWAYS_INLINE static inline void tu_delay(uint32_t ms) { | ||
// msp430 can run up to 25Mhz -> 40ns per cycle. 1 ms = 25000 cycles | ||
// each loop need 4 cycle: 1 sub, 1 cmp, 1 jump, 1 nop | ||
volatile uint32_t cycles = (25000 * ms) >> 2; |
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.
delay using nop where msp430 can run up to 25Mhz
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.
thank you very much, sorry for late response. I have update the PR to use blocking delay (cycle burning, taking consideration for msp430 can run at max 25Mhz). Since there is no generic delay API for tinyusb at the moment. We can change this later should we decide to have an generic time function later on.
PS: I also add some changes to get cmake build support (which I am using) for msp430 as well.
Describe the PR
Adding supported for hot plugging while using external power.
Additional context