AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
236 stars 141 forks source link

Add PMW3901 (flow) sensor support. #347

Closed simonjwright closed 4 years ago

simonjwright commented 4 years ago

The PMW3901 sensor from PixArt Imaging detects lateral motion of the sensor, using optical imaging. This can be used for drone stabilization.

~This patch includes a separate function to check whether an SPI port is enabled. This is used in a precondition. It might be thought reasonable to include such a feature in the standard STM32.Device unit; on the other hand , it’ll be pretty obvious if the device isn’t enabled, since nothing will happen, so maybe the precondition isn’t a good idea. It could be removed.~

simonjwright commented 4 years ago

OK, I see what I did wrong there. Will rethink.

Fabien-Chouteau commented 4 years ago

Thank you @simonjwright this is a cool sensor.

Fabien-Chouteau commented 4 years ago

Hi @simonjwright , do you mind re-basing your patches on master? I have merged the Community 2020 support.

Thanks,

simonjwright commented 4 years ago

Successfully rebased, hope OK

Fabien-Chouteau commented 4 years ago

Also needs a rebase from master:

git pull --rebase --autostash https://github.com/AdaCore/Ada_Drivers_Library master
simonjwright commented 4 years ago

Look, I’m sorry, this has ended up with 16 commits! I’d be quite happy to cancel this merge request and start again. I expect the same thing will happen with #346.

Fabien-Chouteau commented 4 years ago

Looks like it is because your original commit (https://github.com/AdaCore/Ada_Drivers_Library/pull/347/commits/89c54e73732151bd6c2b4eb1becb36a4e04c6344) is still in the branch and before mines.

simonjwright commented 4 years ago

Added a cleaned-up pull request #348.

(Thinking back, I don’t see why it was necessary to rebase? the 2020 changes and these didn’t appear to impact each other)