Skip to content

Commit c64ee59

Browse files
committed
Fixes in update, hal and prepared release v0.1-rc
1 parent 80e524e commit c64ee59

File tree

7 files changed

+60
-17
lines changed

7 files changed

+60
-17
lines changed

Unix/files.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ file:662:logger.py
1111
file:1367:main.py
1212
file:3259:management.py
1313
file:309:updates_app.py
14-
file:1192:updates_pythings.py
14+
file:1212:updates_pythings.py
1515
file:734:updates_settings.py
1616
file:1702:utils.py
17-
file:19:version.py
17+
file:18:version.py
1818
file:846:worker.py

common/updates_pythings.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@
44
import os
55
from arch import arch
66

7-
BASE ='http://backend.pythings.io/static/dist/{}/'.format(arch)
8-
97
def update_pythings(version):
8+
source='http://backend.pythings.io/static/dist/PythingsOS/{}/{}/'.format(version,arch)
109
path='/'+version
1110
try:
1211
os.mkdir(path)
1312
except OSError as e:
1413
pass
1514
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
1817
files_list = open(path+'/files.txt')
1918
for item in files_list.read().split('\n'):
2019
if 'file:' in item:
2120
filename=item.split(':')[2]
2221
if filename=='app.py': continue
2322
filesize=item.split(':')[1]
24-
download(BASE+version+'/'+filename, path+'/'+filename)
23+
download(source+'/'+filename, path+'/'+filename)
2524
if os.stat(path+'/'+filename)[6] != int(filesize):
2625
logger.error('Aborting: file expected size={}, actual size={}.'.format(filesize,os.stat(path+'/'+filename)[6]))
2726
os.remove(path+'/'+filename)

common/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version='v0.1-pre'
1+
version='v0.1-rc'

esp8266/files.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ file:17:arch.py
33
file:2257:common.py
44
file:394:files.txt
55
file:0:globals.py
6-
file:964:hal.py
6+
file:892:hal.py
77
file:620:handle_main_error.py
88
file:3142:http.py
99
file:6579:init.py
1010
file:662:logger.py
1111
file:1367:main.py
1212
file:3259:management.py
1313
file:309:updates_app.py
14-
file:1192:updates_pythings.py
14+
file:1212:updates_pythings.py
1515
file:734:updates_settings.py
1616
file:1702:utils.py
17-
file:19:version.py
17+
file:18:version.py
1818
file:7796:websetup.py
1919
file:846:worker.py

esp8266/hal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Constants (settings)
66
HW_SUPPORTS_DEEPSLEEP = True
77
HW_SUPPORTS_RESETCAUSE = True
8-
HW_SUPPORTS_LED = True
8+
HW_SUPPORTS_LED = False
99
HW_SUPPORTS_WLAN = True
1010

1111
# Required if resetcause is supported
@@ -19,10 +19,10 @@ def init():
1919
class LED(object):
2020
@staticmethod
2121
def on():
22-
machine.Pin(2, machine.Pin.OUT).low()
22+
pass
2323
@staticmethod
2424
def off():
25-
machine.Pin(2, machine.Pin.OUT).high()
25+
pass
2626

2727
class WLAN(object):
2828
@staticmethod

esp8266_esp-12/files.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ file:662:logger.py
1111
file:1367:main.py
1212
file:3259:management.py
1313
file:309:updates_app.py
14-
file:1192:updates_pythings.py
14+
file:1212:updates_pythings.py
1515
file:734:updates_settings.py
1616
file:1702:utils.py
17-
file:19:version.py
17+
file:18:version.py
1818
file:7796:websetup.py
1919
file:846:worker.py

esp8266_esp-12/hal.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

esp8266_esp-12/hal.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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()

0 commit comments

Comments
 (0)