-
Notifications
You must be signed in to change notification settings - Fork 3k
USB basic and hid greentea test cleanup and enable to the bare metal profile #12916
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
Conversation
4b2fcd6
to
db8f07e
Compare
db8f07e
to
5bdd2c1
Compare
TESTS/usb_device/basic/USBTester.cpp
Outdated
@@ -174,7 +177,7 @@ void USBTester::callback_request(const setup_packet_t *setup) | |||
} | |||
} | |||
|
|||
if (delay) { | |||
if (delay != std::chrono::duration<int, std::milli>::zero()) { |
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.
If you want to use the method, better to just say delay.zero()
. But you may as well just say 0s
in normal life, I think. Using the zero()
method is only really worth it where it's important to maintain the specific type.
Yes 0s
is 64-bit, so it does make it a !=
comparison of a 32-bit millisecond count to a 64-bit zero, but the compiler should, I hope, realise it doesn't actually need to do any 64-bit work for that. Maybe you could check if != 0s
is bigger than != delay.zero()
on each toolchain? Put my mind at rest.
(But as this is test code, I wouldn't even sweat 32-bit/64-bit anyway. I'd have just made delay be milliseconds
(ie 64-bit) to save typing.)
And you already used 0s
above when you initialised it, so you're not being consistent!
TESTS/usb_device/basic/USBTester.cpp
Outdated
queue = mbed::mbed_highprio_event_queue(); | ||
#else |
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.
Is there any record in the logs of why it was using high priority specifically? I guess it's working as normal.
If there's no downside, I'd make it normal priority always. If there is a downside, put a comment about it here.
TESTS/usb_device/basic/USBTester.cpp
Outdated
@@ -45,6 +43,7 @@ | |||
|
|||
#define EVENT_READY (1 << 0) | |||
|
|||
using namespace std::chrono_literals; |
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.
Don't forget you can using namespace std::chrono
instead to save typing std::chrono::duration
. or std::chrono::milliseconds
.
a14eeae
to
e6195ef
Compare
@@ -173,7 +171,6 @@ USBEndpointTester::USBEndpointTester(USBPhy *phy, uint16_t vendor_id, uint16_t p | |||
MBED_ASSERT(_endpoint_buffs[i] != NULL); | |||
} | |||
MBED_ASSERT(resolver.valid()); | |||
queue = mbed::mbed_highprio_event_queue(); |
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.
by removing the queue here, the test does not change - it has not been used at all?
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.
yes. This queue initially added by Russ to create a utility function but the scope of this work became obsolete. This queue is not used any of the test cases on full profile.
@@ -32,7 +30,6 @@ | |||
#define VENDOR_TEST_CTRL_NONE 3 | |||
#define VENDOR_TEST_CTRL_IN_DELAY 4 | |||
#define VENDOR_TEST_CTRL_OUT_DELAY 5 | |||
#define VENDOR_TEST_CTRL_NONE_DELAY 6 |
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.
why is this delay removed? Shall this be a series of commits rather than "enable usb basic" - does not provide a reason for some changes I am commenting now on
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.
Removed the USB endpoint test class unused variable and partially (The greentea test host side implementation is missed on pyusb_basic.py ) implemented USB request control transfer of VENDOR_TEST_CTRL_NONE_DELAY so it can run with the bare metal profile.
This would explain some changes, should be in the commit msg as well.
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.
@0xc0170 Done. Please check
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 think it is worth deleting VENDOR_TEST_CTRL_NONE_DELAY (here and in the .py file) because it breaks the defines and it is not the only one not implemented. For example I don't see any code calling VENDOR_TEST_CTRL_IN_STATUS_DELAY or VENDOR_TEST_CTRL_OUT_STATUS_DELAY
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.
After discussion with @evedon have decided to remove all unused USB control transfer request type and also partially implemented test.
e6195ef
to
772c7bd
Compare
- Enable the USB hid and basic test for bare metal profile. - Remove the partially (The green tea test host side implementation is missing on pyusb_basic.py ) implemented USB control transfer VENDOR_TEST_CTRL_NONE_DELAY request type test case as it is becoming obsolete. - Remove high priority event queue which is used by that request type test case.
772c7bd
to
f7f0681
Compare
353d263
to
9e657c6
Compare
9e657c6
to
61c70e0
Compare
@adbridge This PR is for Mbed 6.0 |
Test run: SUCCESSSummary: 4 of 4 test jobs passed |
Summary of changes
VENDOR_TEST_CTRL_NONE_DELAY
andVENDOR_TEST_CTRL_NONE
request type as it is becoming obsolete.VENDOR_TEST_CTRL_IN_DELAY
,VENDOR_TEST_CTRL_OUT_DELAY
,VENDOR_TEST_CTRL_IN_STATUS_DELAY
,VENDOR_TEST_CTRL_OUT_STATUS_DELAY
macros as did not have any test.VENDOR_TEST_CTRL_NONE_DELAY
request type test.Impact of changes
With these changes, USB basic and hid greentea tests build and run successfully.
Migration actions required
None.
Documentation
None.
Pull request type
Test results
Reviewers
@evedon @fkjagodzinski @maciejbocianski