Skip to content

Commit 9082e33

Browse files
authored
Merge pull request #295 from NathanY3G/odroid-h3-support
Add support for Hardkernel ODROID-H3
2 parents 16516c7 + 694fa24 commit 9082e33

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

.pylintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ indent-string=' '
223223
max-line-length=100
224224

225225
# Maximum number of lines in a module
226-
max-module-lines=1000
226+
#
227+
# XXX: Reduce this number once Issue 296 is resolved.
228+
max-module-lines=1050
227229

228230
# List of optional constructs for which whitespace checking is disabled. `dict-
229231
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.

adafruit_platformdetect/board.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ def id(self) -> Optional[str]:
175175
board_id = self._udoo_id()
176176
elif chip_id == chips.PENTIUM_N3710:
177177
board_id = self._udoo_id()
178+
elif chip_id == chips.CELERON_N5105:
179+
board_id = self._intel_n_series_id()
178180
elif chip_id == chips.STM32MP157:
179181
board_id = self._stm32mp1_id()
180182
elif chip_id == chips.STM32MP157DAA1:
@@ -586,6 +588,13 @@ def _udoo_id(self) -> Optional[str]:
586588

587589
return None
588590

591+
def _intel_n_series_id(self) -> Optional[str]:
592+
"""Try to detect the id of an Intel N-Series board."""
593+
if self.detector.check_board_name_value() == "ODROID-H3":
594+
return boards.ODROID_H3
595+
596+
return None
597+
589598
def _j4105_id(self) -> Optional[str]:
590599
"""Try to detect the id of J4105 board."""
591600
try:
@@ -754,6 +763,11 @@ def any_odroid_40_pin(self) -> bool:
754763
"""Check whether the current board is any defined 40-pin Odroid."""
755764
return self.id in boards._ODROID_40_PIN_IDS
756765

766+
@property
767+
def any_odroid_mini_pc(self) -> bool:
768+
"""Check whether the current board is any defined Odroid Mini PC."""
769+
return self.id in boards._ODROID_MINI_PC_IDS
770+
757771
@property
758772
def khadas_vim3_40_pin(self) -> bool:
759773
"""Check whether the current board is any defined 40-pin Khadas VIM3."""
@@ -880,6 +894,7 @@ def lazily_generate_conditions():
880894
yield self.any_jetson_board
881895
yield self.any_coral_board
882896
yield self.any_odroid_40_pin
897+
yield self.any_odroid_mini_pc
883898
yield self.khadas_vim3_40_pin
884899
yield self.any_96boards
885900
yield self.any_sifive_board

adafruit_platformdetect/chip.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ def _linux_id(self) -> Optional[str]:
308308
## print('model_name =', model_name)
309309
if "N3710" in model_name:
310310
linux_id = chips.PENTIUM_N3710
311+
if "N5105" in model_name:
312+
linux_id = chips.CELERON_N5105
311313
elif "X5-Z8350" in model_name:
312314
linux_id = chips.ATOM_X5_Z8350
313315
elif "J4105" in model_name:

adafruit_platformdetect/constants/boards.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
ODROID_C1_PLUS = "ODROID_C1_PLUS"
130130
ODROID_C2 = "ODROID_C2"
131131
ODROID_C4 = "ODROID_C4"
132+
ODROID_H3 = "ODROID_H3"
132133
ODROID_N2 = "ODROID_N2"
133134
ODROID_XU4 = "ODROID_XU4"
134135
ODROID_M1 = "ODROID_M1"
@@ -355,6 +356,8 @@
355356
ODROID_M1,
356357
)
357358

359+
_ODROID_MINI_PC_IDS = (ODROID_H3,)
360+
358361
_BEAGLEBONE_IDS = (
359362
BEAGLE_PLAY,
360363
BEAGLEBONE_AI64,

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
RK3568B2 = "RK3568B2"
6464
RK3588 = "RK3588"
6565
PENTIUM_N3710 = "PENTIUM_N3710" # SOC Braswell core
66+
CELERON_N5105 = "CELERON_N5105"
6667
STM32F405 = "STM32F405"
6768
RP2040 = "RP2040"
6869
STM32MP157 = "STM32MP157"

0 commit comments

Comments
 (0)