We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b794019 commit e28f87eCopy full SHA for e28f87e
adafruit_wiznet5k/adafruit_wiznet5k_socket.py
@@ -24,8 +24,8 @@
24
25
import gc
26
import time
27
+from sys import byteorder
28
from micropython import const
-
29
import adafruit_wiznet5k as wiznet5k
30
31
# pylint: disable=invalid-name
@@ -90,6 +90,8 @@ def htonl(x: int) -> int:
90
91
:return int: 32-bit positive integer in network byte order.
92
"""
93
+ if byteorder == "big":
94
+ return x
95
return int.from_bytes(x.to_bytes(4, "little"), "big")
96
97
@@ -101,6 +103,8 @@ def htons(x: int) -> int:
101
103
102
104
:return int: 16-bit positive integer in network byte order.
105
106
107
108
return ((x << 8) & 0xFF00) | ((x >> 8) & 0xFF)
109
110
0 commit comments