Skip to content
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

stm32: add NadHAT PYBF405 board support (v2) #5217

Merged
merged 3 commits into from
Oct 18, 2019

Conversation

dpgeorge
Copy link
Member

Cleaned up version of #5124 to make ports/stm32/accel.c more generic.

@dpgeorge
Copy link
Member Author

@garatronic can you please test this on your board to see that it still works correctly?

Also, what is the name of the board? The directory you added is NADHAT_PYBF405, but MICROPY_HW_BOARD_NAME is just PYBF405. It would be good to make them match, and also not cause confusing with the actual PYBv1.x boards.

@garatronic
Copy link
Contributor

I'll do the tests and changes. Thanks.
I deleted my last commit (i wanted to remove the useless conditional index, zero can be divided by everything.. but zero Hope this will not affect this git.

@garatronic
Copy link
Contributor

The code work fine. I don't understand why, but my compiler do not like line 237
CC accel.c accel.c: In function 'pyb_accel_filtered_xyz': accel.c:237:5: error: variable-sized object may not be initialized uint8_t data[DATA_SIZE] = { ACCEL_REG_X }; ^~~~~~~ accel.c:73:37: error: excess elements in array initializer [-Werror] #define ACCEL_REG_X 0x07 // XOUT_H ^ accel.c:237:33: note: in expansion of macro 'ACCEL_REG_X' uint8_t data[DATA_SIZE] = { ACCEL_REG_X }; ^~~~~~~~~~~ accel.c:73:37: note: (near initialization for 'data') #define ACCEL_REG_X 0x07 // XOUT_H ^ accel.c:237:33: note: in expansion of macro 'ACCEL_REG_X' uint8_t data[DATA_SIZE] = { ACCEL_REG_X }; ^~~~~~~~~~~ cc1: all warnings being treated as errors
I update my compiler to the lastest version : from 7.2_2017q4 to 8-2019-q3. Same error.
So i split the declaration and initialization of the array.
I change the range of KXT accelerometer to +/- 8G to have something working with xyz_filtering method. All work in that case. Also changed board name. Pull all in one commit on my deposit.
Hope it will be the good one.

@dpgeorge dpgeorge force-pushed the stm32-garatronic-nadhat-board branch from 4505b44 to 925f244 Compare October 18, 2019 00:42
@dpgeorge dpgeorge merged commit 925f244 into micropython:master Oct 18, 2019
@dpgeorge dpgeorge deleted the stm32-garatronic-nadhat-board branch October 18, 2019 00:58
@dpgeorge
Copy link
Member Author

So i split the declaration and initialization of the array.

Ok, thanks, that change has been incorporated.

I change the range of KXT accelerometer to +/- 8G to have something working with xyz_filtering method. All work in that case. Also changed board name.

I also incorporated these changes. Thanks for testing!

@garatronic
Copy link
Contributor

garatronic commented Oct 18, 2019 via email

tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants