-
Notifications
You must be signed in to change notification settings - Fork 72
Core api update tone #351
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
base: core-api-update
Are you sure you want to change the base?
Core api update tone #351
Conversation
7f9266f
to
9e79031
Compare
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.
Nice!
dicussed in the call, Tont will be merged first and then the analog function.
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.
Looks very good 👍
XMC_GPIO_MODE_OUTPUT_PUSH_PULL | pwm4->port_mode); | ||
XMC_CCU4_SLICE_StartTimer(pwm4->slice); | ||
// count pulses for stop the timer once reached required pulses | ||
if (duration > 0) { |
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.
So if a duration is set the function is blocking or?
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.
yep, I will change the logic. before, I used timer but one test case got failed due to time variation(100ms)
I will revisit and change.
@@ -73,6 +73,8 @@ extern "C" { | |||
|
|||
#define interrupts() __enable_irq() | |||
#define noInterrupts() __disable_irq() | |||
#define ENABLED 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.
Where are these defines used?
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.
In pins_arduino.h for ADC and PWM pins configurationsL like here: https://github.com/Infineon/XMC-for-Arduino/blob/master/variants/XMC4700/config/XMC4700_Relax_Kit/pins_arduino.h#L331
Maybe modify macro to be XMC_ENABLED or simply use false/true for all xmc struct.
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 the naming is too generic for potential conflict with any other code not coming from XMC deciding to declare such.
We have already experienced that with macros like GPIO, ADC and such.
They help to understand more what that flag/variable does. But this is also not user level code, so maybe the simplest is to stay with true and false :)
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 the two issues juan mentioned need to be fixed
- tone(duration) should not be blocking call -> maybe this is reason of scheduler code in timer module?
- true and false instad of ENABLED and DISABLED macro.
Signed-off-by: MDin <Dinesh.M-EE@infineon.com>
Signed-off-by: MDin <Dinesh.M-EE@infineon.com>
Signed-off-by: MDin <Dinesh.M-EE@infineon.com>
Signed-off-by: MDin <Dinesh.M-EE@infineon.com>
Signed-off-by: MDin <Dinesh.M-EE@infineon.com>
Signed-off-by: MDin <Dinesh.M-EE@infineon.com>
Signed-off-by: MDin <Dinesh.M-EE@infineon.com>
Signed-off-by: zhanglinjing <Linjing.Zhang@infineon.com>
0582e0f
to
2911542
Compare
By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---
CONTRIBUTING.md also tells you what to expect in the PR process.
Description
Tone function implemented using PWM method. In XMC we have two modes CCU4 and CCU8 . configured for all the PWM pins.
Related Issue

Removed delay in test_main.ino because test case not running in continuous loop.
Context
Tested with 4700 Board, connected jumber wire in between interrupt pin and pwm pin.