File tree Expand file tree Collapse file tree 7 files changed +60
-17
lines changed Expand file tree Collapse file tree 7 files changed +60
-17
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ file:662:logger.py
11
11
file:1367:main.py
12
12
file:3259:management.py
13
13
file:309:updates_app.py
14
- file:1192 :updates_pythings.py
14
+ file:1212 :updates_pythings.py
15
15
file:734:updates_settings.py
16
16
file:1702:utils.py
17
- file:19 :version.py
17
+ file:18 :version.py
18
18
file:846:worker.py
Original file line number Diff line number Diff line change 4
4
import os
5
5
from arch import arch
6
6
7
- BASE = 'http://backend.pythings.io/static/dist/{}/' .format (arch )
8
-
9
7
def update_pythings (version ):
8
+ source = 'http://backend.pythings.io/static/dist/PythingsOS/{}/{}/' .format (version ,arch )
10
9
path = '/' + version
11
10
try :
12
11
os .mkdir (path )
13
12
except OSError as e :
14
13
pass
15
14
from http import download
16
- if not download (BASE + version + '/files.txt' , path + '/files.txt' ):
17
- return
15
+ if not download (source + '/files.txt' , path + '/files.txt' ):
16
+ return False
18
17
files_list = open (path + '/files.txt' )
19
18
for item in files_list .read ().split ('\n ' ):
20
19
if 'file:' in item :
21
20
filename = item .split (':' )[2 ]
22
21
if filename == 'app.py' : continue
23
22
filesize = item .split (':' )[1 ]
24
- download (BASE + version + '/' + filename , path + '/' + filename )
23
+ download (source + '/' + filename , path + '/' + filename )
25
24
if os .stat (path + '/' + filename )[6 ] != int (filesize ):
26
25
logger .error ('Aborting: file expected size={}, actual size={}.' .format (filesize ,os .stat (path + '/' + filename )[6 ]))
27
26
os .remove (path + '/' + filename )
Original file line number Diff line number Diff line change 1
- version = 'v0.1-pre '
1
+ version = 'v0.1-rc '
Original file line number Diff line number Diff line change @@ -3,17 +3,17 @@ file:17:arch.py
3
3
file:2257:common.py
4
4
file:394:files.txt
5
5
file:0:globals.py
6
- file:964 :hal.py
6
+ file:892 :hal.py
7
7
file:620:handle_main_error.py
8
8
file:3142:http.py
9
9
file:6579:init.py
10
10
file:662:logger.py
11
11
file:1367:main.py
12
12
file:3259:management.py
13
13
file:309:updates_app.py
14
- file:1192 :updates_pythings.py
14
+ file:1212 :updates_pythings.py
15
15
file:734:updates_settings.py
16
16
file:1702:utils.py
17
- file:19 :version.py
17
+ file:18 :version.py
18
18
file:7796:websetup.py
19
19
file:846:worker.py
Original file line number Diff line number Diff line change 5
5
# Constants (settings)
6
6
HW_SUPPORTS_DEEPSLEEP = True
7
7
HW_SUPPORTS_RESETCAUSE = True
8
- HW_SUPPORTS_LED = True
8
+ HW_SUPPORTS_LED = False
9
9
HW_SUPPORTS_WLAN = True
10
10
11
11
# Required if resetcause is supported
@@ -19,10 +19,10 @@ def init():
19
19
class LED (object ):
20
20
@staticmethod
21
21
def on ():
22
- machine . Pin ( 2 , machine . Pin . OUT ). low ()
22
+ pass
23
23
@staticmethod
24
24
def off ():
25
- machine . Pin ( 2 , machine . Pin . OUT ). high ()
25
+ pass
26
26
27
27
class WLAN (object ):
28
28
@staticmethod
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ file:662:logger.py
11
11
file:1367:main.py
12
12
file:3259:management.py
13
13
file:309:updates_app.py
14
- file:1192 :updates_pythings.py
14
+ file:1212 :updates_pythings.py
15
15
file:734:updates_settings.py
16
16
file:1702:utils.py
17
- file:19 :version.py
17
+ file:18 :version.py
18
18
file:7796:websetup.py
19
19
file:846:worker.py
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+
2
+ import machine
3
+ import network
4
+
5
+ # Constants (settings)
6
+ HW_SUPPORTS_DEEPSLEEP = True
7
+ HW_SUPPORTS_RESETCAUSE = True
8
+ HW_SUPPORTS_LED = True
9
+ HW_SUPPORTS_WLAN = True
10
+
11
+ # Required if resetcause is supported
12
+ HARD_RESET = 6
13
+
14
+ def init ():
15
+ # i.e. turn off extra LEDs and lower PWMs
16
+ pass
17
+
18
+ # Objects
19
+ class LED (object ):
20
+ @staticmethod
21
+ def on ():
22
+ machine .Pin (2 , machine .Pin .OUT ).low ()
23
+ @staticmethod
24
+ def off ():
25
+ machine .Pin (2 , machine .Pin .OUT ).high ()
26
+
27
+ class WLAN (object ):
28
+ @staticmethod
29
+ def sta_active (mode ):
30
+ network .WLAN (network .STA_IF ).active (mode )
31
+ @staticmethod
32
+ def ap_active (mode ):
33
+ network .WLAN (network .AP_IF ).active (mode )
34
+
35
+ def get_tuuid ():
36
+ wlan = network .WLAN (network .STA_IF )
37
+ mac_b = wlan .config ('mac' )
38
+ mac_s = ':' .join ( [ "%02X" % x for x in mac_b ] )
39
+ return mac_s .replace (':' ,'' )
40
+
41
+ def reset_cause ():
42
+ return machine .reset_cause ()
43
+
44
+ def reboot ():
45
+ machine .reset ()
You can’t perform that action at this time.
0 commit comments