Skip to content

Conversation

yeyeto2788
Copy link
Contributor

As commented in issue #55

@makermelissa makermelissa requested a review from a team January 20, 2020 19:37
@makermelissa
Copy link
Collaborator

Which boards have you tested this with?

@yeyeto2788
Copy link
Contributor Author

yeyeto2788 commented Jan 20, 2020

Hey! I actually tested it on my linux machine but not on any board. If you want me to I can test it on my boards.

It should actually work on all boards since the refactor is only moving constants to other modules and no logic have been changed rather that the any_embedded_linux method for a more "pythonic" way and easier to understand.

@ladyada
Copy link
Member

ladyada commented Jan 20, 2020

@makermelissa i think test this on a Pi, and maybe with an FT232H? that gets you two different techniques

@yeyeto2788
Copy link
Contributor Author

Here is the output from the recently added Orange Pi Plus 2E:

root@orangepiplus2e:/workspace/Adafruit_Python_PlatformDetect# git pull
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (26/26), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 26 (delta 10), reused 19 (delta 6), pack-reused 0
Unpacking objects: 100% (26/26), done.
From https://github.com/yeyeto2788/Adafruit_Python_PlatformDetect
 * [new branch]      module_refactor -> origin/module_refactor
Already up to date.
root@orangepiplus2e:/workspace/Adafruit_Python_PlatformDetect# git checkout module_refactor 
Branch 'module_refactor' set up to track remote branch 'module_refactor' from 'origin'.
Switched to a new branch 'module_refactor'
root@orangepiplus2e:/workspace/Adafruit_Python_PlatformDetect# python3
Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import adafruit_platformdetect
>>> detector = adafruit_platformdetect.Detector()                                                                                                                                  
>>> detector.board.id                                                                                                                                                              
'ORANGE_PI_PLUS_2E'                                                                                                                                                                
>>> detector.chip.id                                                                                                                                                               
'SUN8I'                                                                                                                                                                            
>>> detector.board.any_embedded_linux
True
>>> 

If desired I can test it on other boards.

@yeyeto2788
Copy link
Contributor Author

I just want to point out that I'm working on the changes in Blinka since this will affect it.

Changing things like the line 33 on adafruit_blinka.board should do the trick,
from

import adafruit_platformdetect.board as ap_board

to

import adafruit_platformdetect.constants.boards as ap_board

As far as I could see these are the following modules needed to be change in blinka:

  • adafruit_blinka.microcontroller
  • adafruit_blinka.agnostic
  • adafruit_blinka.bitbangio
  • adafruit_blinka.busio
  • adafruit_blinka.microcontroller.pin

So IMHO there is no hurry delivering this to PyPi

yeyeto2788 added a commit to yeyeto2788/Adafruit_Blinka that referenced this pull request Jan 20, 2020
@makermelissa
Copy link
Collaborator

Ok, just found my ft232h board. I'll test this today.

@makermelissa
Copy link
Collaborator

Tested successfully on a Raspberry Pi 4B and the FT232H on a windows computer.

@makermelissa
Copy link
Collaborator

@yeyeto2788, should we wait on your Blinka changes before merging this or do you think this will break something?

@yeyeto2788
Copy link
Contributor Author

Hey @makermelissa, yes I would recommend to wait for it. I'll create the PR in a few minutes.

@makermelissa makermelissa merged commit d806552 into adafruit:master Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants