-
Notifications
You must be signed in to change notification settings - Fork 120
feat(Examples): MSDK-1250: Add OWM Example for MAX32690 #1457
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: main
Are you sure you want to change the base?
feat(Examples): MSDK-1250: Add OWM Example for MAX32690 #1457
Conversation
Signed-off-by: Dung Nguyen <dung.nguyen@analog.com>
ttmut
left a comment
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.
Thanks for the work! I’ve left some comments, mostly concerning styling.
| void setcrc8(uint8_t reset) | ||
| { | ||
| utilcrc8 = reset; | ||
| return; |
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.
| return; |
| utilcrc8 = dscrc_table[utilcrc8 ^ x]; | ||
| return utilcrc8; |
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.
| utilcrc8 = dscrc_table[utilcrc8 ^ x]; | |
| return utilcrc8; | |
| utilcrc8 = dscrc_table[utilcrc8 ^ x]; | |
| return utilcrc8; |
For readability.
| if (MXC_OWM_Reset() == 1) { | ||
| //printf("OK: 1-wire devices reponded during the presence pulse\n"); | ||
| } else { | ||
| return -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.
| if (MXC_OWM_Reset() == 1) { | |
| //printf("OK: 1-wire devices reponded during the presence pulse\n"); | |
| } else { | |
| return -2; | |
| } | |
| if (MXC_OWM_Reset() == 1) { | |
| printf("OK: 1-wire devices reponded during the presence pulse\n"); | |
| } else { | |
| printf("FAIL: Relevant error message here\n"); | |
| return -2; | |
| } |
Could do this or just
| if (MXC_OWM_Reset() == 1) { | |
| //printf("OK: 1-wire devices reponded during the presence pulse\n"); | |
| } else { | |
| return -2; | |
| } | |
| if (MXC_OWM_Reset() != 1) { | |
| printf("FAIL: Relevant error message here\n"); | |
| return -2; | |
| } |
| if (MXC_OWM_Reset() == 1) { | ||
| //printf("OK: 1-wire devices reponded during the presence pulse after Overdrive\n"); | ||
| } else { | ||
| return -4; | ||
| } |
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.
Same as above.
| /* Read the ROM ID */ | ||
| memset(buffer, 0, sizeof(buffer)); | ||
| if (MXC_OWM_Read(buffer, 8) < 0) { | ||
| return -5; |
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.
Might be a good idea to add an error log here 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.
We only need a single newline.
| "__GNUC__" | ||
| ], | ||
| "intelliSenseMode": "gcc-arm", | ||
| "compilerPath": "${config:cfs.toolchain.armAArch32GCC.path}/bin/arm-none-eabi-gcc.exe", |
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 do not think this file is supposed to hold CFS references. You can copy from an existing example and adjust accordingly.
| { | ||
| "configurations": [ | ||
| { | ||
| "name": "CFS: Debug with GDB and OpenOCD (ARM Embedded)", |
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.
Again, this file seems to be tailored towards CFS integration. I suggest using launch.json from an existing example as a reference.
| "C_Cpp.default.forcedInclude": [ | ||
| "${workspaceFolder}/build/project_defines.h" | ||
| ], | ||
| "cfs.project.target": "MAX32690", |
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.
Same as above.
| # | ||
| # Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by | ||
| # Analog Devices, Inc.), | ||
| # Copyright (C) 2023-2024 Analog Devices, Inc. |
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.
| # Copyright (C) 2023-2024 Analog Devices, Inc. | |
| # Copyright (C) 2023-2025 Analog Devices, Inc. |
Description
Add OWM example for MAX32690 to read ROM-ID of 1-Wire slave device
Connect 1-Wire pin, VCC and GND to the target.
Checklist Before Requesting Review