Skip to content

Commit 0a87740

Browse files
committed
Merge branch 'release/v0.1.2-alpha'
2 parents 4353a8c + 50f1125 commit 0a87740

20 files changed

Lines changed: 230 additions & 190 deletions

CHANGES.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# uPiot Release Notes
22

3+
## Version 0.1.2-alpha | 04 Nov 2017
4+
5+
#### New
6+
7+
* Command to send a cancel string (\x03) through the serial port including a shortcut (ctrl+shift+c).
8+
9+
#### Improvements
10+
11+
* Avoid to send empty string to the console when it's waiting for new data
12+
* Activate the window console each time it's open or called from a sampy command.
13+
* Warn the user to restart ST after uPiot is updated.
14+
* 'sampy run' will now display the output in realtime.
15+
16+
#### Bugs
17+
18+
* Removed hardcoded strings to burn the firmware in other boards.
19+
* Fix console call when multiples boards are connected (Issue: #1).
20+
21+
322
## Version 0.1.1-alpha | 28 Oct 2017
423

524
#### Improvements

Default (Linux).sublime-keymap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@
2222
},{
2323
"keys": ["ctrl+alt+p"],
2424
"command": "upiot_put_current_file"
25+
},{
26+
"keys": ["ctrl+shift+c"],
27+
"command": "upiot_raw_serial",
28+
"args": {"data": "\\x03"}
2529
}
2630
]

Default (OSX).sublime-keymap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@
2222
},{
2323
"keys": ["ctrl+alt+p"],
2424
"command": "upiot_put_current_file"
25+
},{
26+
"keys": ["ctrl+shift+c"],
27+
"command": "upiot_raw_serial",
28+
"args": {"data": "\\x03"}
2529
}
2630
]

Default (Windows).sublime-keymap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@
2222
},{
2323
"keys": ["ctrl+alt+p"],
2424
"command": "upiot_put_current_file"
25+
},{
26+
"keys": ["ctrl+shift+c"],
27+
"command": "upiot_raw_serial",
28+
"args": {"data": "\\x03"}
2529
}
2630
]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ List of options available in the command menu. (`ctrl+alt+m`)
112112
|Put Current File|Puts the focused file your device|
113113
|Run Current File|Runs the focused file your device|
114114
|Select Serial Port|Selects the serial port to be used in the Console or `Burn Firmware` command|
115+
|Cancel (Ctrl + C)|Sends a cancel string to the open serial port (\x03)|
115116
|Write in Console|Sends an string through the serial port. You can also use the [Console commands]|
116117
|Sync File From Device|Search all files in your device and save it in the given location|
117118
|Help|Opens this github|
@@ -125,6 +126,7 @@ At this moment, there is 4 importantant shorcuts:
125126
* `ctrl+alt+o` Opents the uPiot console
126127
* `ctrl+alt+r` Runs the current file
127128
* `ctrl+alt+p` Puts the current file
129+
* `ctrl+shift+c` Sends a cancel string to the open serial port (\x03)
128130

129131
I haven't test the shortcuts in all platforms, if you have any problem [open a issue](https://github.com/gepd/uPiot-MicroPython-Tool/issues)
130132

commands/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from .select_board import upiotSelectBoardCommand
4141
from .sampy_help import upiotSampyHelpCommand
4242
from .min_origami import upiotCreatePaneCommand
43+
from .raw_serial import upiotRawSerialCommand
4344

4445
__all__ = [
4546
'upiotBurnFirmwareCommand',
@@ -59,5 +60,6 @@
5960
'upiotConsoleCommand',
6061
'upiotConsoleWriteCommand',
6162
'upiotSampyHelpCommand',
62-
'upiotCreatePaneCommand'
63+
'upiotCreatePaneCommand',
64+
'upiotRawSerialCommand'
6365
]

commands/burn_firmware.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141

4242
class upiotBurnFirmwareCommand(WindowCommand):
43+
board = None
4344
port = None
4445
items = None
4546
firmwares = None
@@ -54,14 +55,14 @@ def run(self, selected=None):
5455
self.items = []
5556

5657
settings = sublime.load_settings(tools.SETTINGS_NAME)
57-
board = settings.get(setting_key, None)
58+
self.board = settings.get(setting_key, None)
5859

5960
if(not selected):
6061
sublime.active_window().run_command('upiot_select_board',
6162
{'action': tools.BURN})
6263
return
6364

64-
self.firmwares = paths.firmware_folder(board)
65+
self.firmwares = paths.firmware_folder(self.board)
6566
self.firmware_list()
6667

6768
tools.quick_panel(self.items, self.callback_selection)
@@ -102,7 +103,7 @@ def burn_firmware(self):
102103
filename = self.url.split('/')[-1]
103104
firmware = join(self.firmwares, filename)
104105

105-
options = self.get_board_options('esp32')
106+
options = self.get_board_options(self.board)
106107
options.append(firmware)
107108

108109
caption = "Do you want to erase the flash memory?"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"caption": "UPIOT: Cancel (Ctrl + C)",
4+
"command": "upiot_raw_serial",
5+
"args": {"data": "\\x03"}
6+
}
7+
]

commands/download_firmware.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def download_firmware(self):
6161
If the file isn't in the firmwares folder, it download the file and
6262
put it in a folder corresponding to the board selection
6363
"""
64-
folder = paths.firmware_folder('esp32')
64+
settings = sublime.load_settings(tools.SETTINGS_NAME)
65+
board = settings.get('board', None)
66+
folder = paths.firmware_folder(board)
6567
tools.make_folder(folder)
6668

6769
tools.ACTIVE_VIEW = self.window.active_view()

commands/raw_serial.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This file is part of the uPiot project, https://github.com/gepd/upiot/
2+
#
3+
# MIT License
4+
#
5+
# Copyright (c) 2017 GEPD
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in
15+
# all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
25+
import sublime
26+
from sublime_plugin import WindowCommand
27+
28+
from ..tools import serial
29+
from ..tools.ampy import pyboard
30+
from ..tools import str_cmd_serial
31+
32+
33+
class upiotRawSerialCommand(WindowCommand):
34+
35+
def run(self, data):
36+
port = serial.selected_port()
37+
38+
try:
39+
sserial = serial.serial_dict[port]
40+
sserial.write(str_cmd_serial(data))
41+
except:
42+
sserial = pyboard.serial_dict[port]
43+
sserial.write(str_cmd_serial(data))

0 commit comments

Comments
 (0)