feat: added build pristine, build configuration, erase and recover
This commit is contained in:
1 parent
80a2c4d56f
commit
5b1d640d4b
11 files changed
+636
-80
No files matched your search
@@ -0,0 +1,40 @@
|
||||
local M = {}
|
||||
|
||||
local function candidates(opts)
|
||||
if opts.monitor_port then
|
||||
return { opts.monitor_port }
|
||||
end
|
||||
return vim.fn.glob("/dev/ttyACM*", false, true)
|
||||
end
|
||||
|
||||
function M.run(opts)
|
||||
local ports = candidates(opts)
|
||||
if #ports == 0 then
|
||||
vim.notify("[hego] ningún /dev/ttyACM*; ¿DK conectado?", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local exec = require("hego.exec")
|
||||
|
||||
local function go(port)
|
||||
-- tio reconecta solo si el puerto re-enumera (p. ej. tras un flash).
|
||||
exec.run_async({ "tio", port }, {
|
||||
title = "hego://monitor",
|
||||
cwd = vim.fn.getcwd(),
|
||||
})
|
||||
end
|
||||
|
||||
if #ports == 1 then
|
||||
return go(ports[1])
|
||||
end
|
||||
|
||||
vim.ui.select(ports, {
|
||||
prompt = "Monitor serie",
|
||||
}, function(c)
|
||||
if c then
|
||||
go(c)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in new issue
Block a user