Compare commits
60 Commits
457058859d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
88fbbc103b
|
|||
|
76fe86a3bc
|
|||
| 6bf43409e4 | |||
|
2374365f0e
|
|||
|
f5f7184965
|
|||
|
|
a2eb47bc59 | ||
| c84d17a4d9 | |||
|
3fecb101b7
|
|||
|
4ce7cc1475
|
|||
|
0f80e087da
|
|||
|
ddba2120e1
|
|||
|
da75d0a2a0
|
|||
|
07144c04eb
|
|||
|
3cda1316ae
|
|||
|
5beb79b51b
|
|||
|
45298bd360
|
|||
|
e1c38f4dc7
|
|||
|
4f47712d27
|
|||
|
80ffc67790
|
|||
|
7501ece574
|
|||
|
e1359f78b5
|
|||
|
543e67929b
|
|||
|
b2dfdcc14a
|
|||
|
dc24bdfa6d
|
|||
|
1b24417acb
|
|||
|
baf3f3c0f8
|
|||
|
c3737936c4
|
|||
|
3adec932bf
|
|||
|
fb0f49fdd5
|
|||
|
8b0735fca2
|
|||
|
8619022374
|
|||
|
6064bd3f70
|
|||
|
72b08b631d
|
|||
|
ac6d94d4a3
|
|||
|
54659389e1
|
|||
|
25d4a96f10
|
|||
|
414396bc3e
|
|||
|
c1fa8bda61
|
|||
|
bbdbed5c25
|
|||
|
27b3f114f0
|
|||
|
a846058098
|
|||
|
259d4b91d8
|
|||
|
43b23ec1ad
|
|||
|
b9f8e90dd7
|
|||
|
c104a44f32
|
|||
|
a94a15230f
|
|||
|
0a7801bf7c
|
|||
|
7844c38e51
|
|||
|
6d22572a75
|
|||
|
33cee85edb
|
|||
|
c418ebcc53
|
|||
|
815779129a
|
|||
|
463843bf8b
|
|||
|
56d26cd751
|
|||
|
038c8752dd
|
|||
|
1c90656508
|
|||
|
d0c0da7ef4
|
|||
|
1fb3cba972
|
|||
|
d5c4dc004c
|
|||
|
265e29d2cf
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/.vscode
|
||||
build
|
||||
build
|
||||
.cache
|
||||
|
||||
233
commander.html
233
commander.html
@@ -25,6 +25,22 @@
|
||||
padding: calc(50vh - 150px) 50px;
|
||||
height: 200px;
|
||||
}
|
||||
.btn {
|
||||
padding: 5px 10px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
#edit_config {
|
||||
position: absolute;
|
||||
background-color: var(--background-second);
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
/* height: 100%; */
|
||||
}
|
||||
#edit_config form {
|
||||
margin: 40px auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -33,8 +49,47 @@
|
||||
<button id="login">login</button>
|
||||
</div>
|
||||
<main>
|
||||
<div id="boatjes"></div>
|
||||
<div id="clients"></div>
|
||||
<div id="refresh" class="btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2z"/>
|
||||
<path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466"/>
|
||||
</svg>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<caption>bootjes</caption>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>naam</th>
|
||||
<th>status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="boatjes"></tbody>
|
||||
</table>
|
||||
<table>
|
||||
<thead>
|
||||
<caption>clients</caption>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>boat</th>
|
||||
<th>status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="clients"></tbody>
|
||||
</table>
|
||||
<div id="edit_config" style="display:none">
|
||||
<form>
|
||||
<input type="hidden" name="boart" />
|
||||
name: <input type="text" name="name" id="edit_name" /><br/>
|
||||
stuur trim max: <input type="range" name="ch0_max" id="edit_ch0_max" max="8192" min="4096" /><br/>
|
||||
stuur trim mid: <input type="range" name="ch0_mid" id="edit_ch0_mid" max="8192" min="0" /><br/>
|
||||
stuur trim min: <input type="range" name="ch0_min" id="edit_ch0_min" max="4096" min="0" /><br/>
|
||||
motor trim max: <input type="range" name="ch1_max" id="edit_ch1_max" max="8192" min="4096" /><br/>
|
||||
motor trim mid: <input type="range" name="ch1_mid" id="edit_ch1_mid" max="8192" min="0" /><br/>
|
||||
motor trim min: <input type="range" name="ch1_min" id="edit_ch1_min" max="4096" min="0" /><br/>
|
||||
<button class="btn" onclick="updateConfig()">toepassen</button> <button class="btn" onclick="document.getElementById('edit_config').style.display = 'none'">anulleren</button>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
const passEl = document.getElementById('pass');
|
||||
@@ -42,16 +97,26 @@
|
||||
const boatjesEl = document.getElementById('boatjes');
|
||||
const clientsEl = document.getElementById('clients');
|
||||
|
||||
// const serverURL = 'ws://10.254.0.1:8080/';
|
||||
const serverURL = 'ws://localhost:8080/';
|
||||
const kickIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-hand-thumbs-down\" viewBox=\"0 0 16 16\"><path d=\"M8.864 15.674c-.956.24-1.843-.484-1.908-1.42-.072-1.05-.23-2.015-.428-2.59-.125-.36-.479-1.012-1.04-1.638-.557-.624-1.282-1.179-2.131-1.41C2.685 8.432 2 7.85 2 7V3c0-.845.682-1.464 1.448-1.546 1.07-.113 1.564-.415 2.068-.723l.048-.029c.272-.166.578-.349.97-.484C6.931.08 7.395 0 8 0h3.5c.937 0 1.599.478 1.934 1.064.164.287.254.607.254.913 0 .152-.023.312-.077.464.201.262.38.577.488.9.11.33.172.762.004 1.15.069.13.12.268.159.403.077.27.113.567.113.856s-.036.586-.113.856c-.035.12-.08.244-.138.363.394.571.418 1.2.234 1.733-.206.592-.682 1.1-1.2 1.272-.847.283-1.803.276-2.516.211a10 10 0 0 1-.443-.05 9.36 9.36 0 0 1-.062 4.51c-.138.508-.55.848-1.012.964zM11.5 1H8c-.51 0-.863.068-1.14.163-.281.097-.506.229-.776.393l-.04.025c-.555.338-1.198.73-2.49.868-.333.035-.554.29-.554.55V7c0 .255.226.543.62.65 1.095.3 1.977.997 2.614 1.709.635.71 1.064 1.475 1.238 1.977.243.7.407 1.768.482 2.85.025.362.36.595.667.518l.262-.065c.16-.04.258-.144.288-.255a8.34 8.34 0 0 0-.145-4.726.5.5 0 0 1 .595-.643h.003l.014.004.058.013a9 9 0 0 0 1.036.157c.663.06 1.457.054 2.11-.163.175-.059.45-.301.57-.651.107-.308.087-.67-.266-1.021L12.793 7l.353-.354c.043-.042.105-.14.154-.315.048-.167.075-.37.075-.581s-.027-.414-.075-.581c-.05-.174-.111-.273-.154-.315l-.353-.354.353-.354c.047-.047.109-.176.005-.488a2.2 2.2 0 0 0-.505-.804l-.353-.354.353-.354c.006-.005.041-.05.041-.17a.9.9 0 0 0-.121-.415C12.4 1.272 12.063 1 11.5 1\"/></svg>"
|
||||
const banIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-slash-circle\" viewBox=\"0 0 16 16\"><path d=\"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16\"/><path d=\"M11.354 4.646a.5.5 0 0 0-.708 0l-6 6a.5.5 0 0 0 .708.708l6-6a.5.5 0 0 0 0-.708\"/></svg>";
|
||||
const openIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-key\" viewBox=\"0 0 16 16\"><path d=\"M0 8a4 4 0 0 1 7.465-2H14a.5.5 0 0 1 .354.146l1.5 1.5a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0L13 9.207l-.646.647a.5.5 0 0 1-.708 0L11 9.207l-.646.647a.5.5 0 0 1-.708 0L9 9.207l-.646.647A.5.5 0 0 1 8 10h-.535A4 4 0 0 1 0 8m4-3a3 3 0 1 0 2.712 4.285A.5.5 0 0 1 7.163 9h.63l.853-.854a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.793-.793-1-1h-6.63a.5.5 0 0 1-.451-.285A3 3 0 0 0 4 5\"/><path d=\"M4 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0\"/></svg>";
|
||||
const lockIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-lock\" viewBox=\"0 0 16 16\"><path d=\"M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2m3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2M5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1\"/></svg>";
|
||||
const freeIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-calendar-event\" viewBox=\"0 0 16 16\"><path d=\"M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z\"/><path d=\"M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z\"/></svg>"
|
||||
const logIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-list-check\" viewBox=\"0 0 16 16\"> <path fill-rule=\"evenodd\" d=\"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5M3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0m0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0\"/></svg>"
|
||||
|
||||
var conn = new WebSocket(serverURL, ['mbcRcRf']);
|
||||
|
||||
loginEl.addEventListener('click', login)
|
||||
const serverURL = 'ws://10.254.0.1:8080/';
|
||||
|
||||
var conn = false;
|
||||
var boats = [];
|
||||
var boatsLocked = [];
|
||||
|
||||
loginEl.addEventListener('click', login);
|
||||
document.getElementById('refresh').addEventListener('click', refreshAll);
|
||||
|
||||
function login(e)
|
||||
{
|
||||
conn.close();
|
||||
if (conn) conn.close();
|
||||
conn = new WebSocket(serverURL, ['mbcRcRf']);
|
||||
conn.addEventListener('open', onOpen);
|
||||
conn.addEventListener('message', onMessage);
|
||||
@@ -59,7 +124,15 @@
|
||||
|
||||
function onOpen(e)
|
||||
{
|
||||
conn.send(passEl.value);
|
||||
conn.send(passEl.value + ";4675;" + Math.floor(new Date().getTime()/1000.0));
|
||||
refreshAll()
|
||||
}
|
||||
|
||||
function refreshAll()
|
||||
{
|
||||
reqBoats();
|
||||
reqLockedBoats();
|
||||
reqClients();
|
||||
}
|
||||
|
||||
function onMessage(e)
|
||||
@@ -72,7 +145,16 @@
|
||||
switch (data)
|
||||
{
|
||||
case 'boats':
|
||||
boatjesEl.innerHTML = "";
|
||||
addBoats(msg);
|
||||
addBoats(boatsLocked);
|
||||
boats = msg;
|
||||
break;
|
||||
case 'lockedBoats':
|
||||
boatjesEl.innerHTML = "";
|
||||
addBoats(boats);
|
||||
addBoats(msg);
|
||||
boatsLocked = msg;
|
||||
passEl.parentElement.style.display = 'none';
|
||||
break;
|
||||
case 'clients':
|
||||
@@ -84,13 +166,69 @@
|
||||
}
|
||||
}
|
||||
|
||||
function getDataFomEl(el)
|
||||
{
|
||||
while (el.tagName != "BODY" && el.dataset['id'] == null)
|
||||
{
|
||||
el = el.parentElement;
|
||||
}
|
||||
return el.dataset;
|
||||
}
|
||||
|
||||
function kickClient(e)
|
||||
{
|
||||
let client = getDataFomEl(e.target);
|
||||
console.log("kickClient", client);
|
||||
conn.send(passEl.value + ";kick;" + client['id']);
|
||||
}
|
||||
|
||||
function freeBoat(e)
|
||||
{
|
||||
let boat = getDataFomEl(e.target);
|
||||
console.log("unlockBoat", boat);
|
||||
conn.send(passEl.value + ";free;" + boat['id']);
|
||||
}
|
||||
|
||||
function lockBoat(e)
|
||||
{
|
||||
let boat = getDataFomEl(e.target);
|
||||
console.log("lockBoat", boat);
|
||||
conn.send(passEl.value + ";lock;" + boat['id']);
|
||||
}
|
||||
|
||||
function getBoatLog(e)
|
||||
{
|
||||
// let cmd = prompt("enter command");
|
||||
let boat = getDataFomEl(e.target);
|
||||
// console.log("send cmd", boat, cmd);
|
||||
// conn.send(passEl.value + ";sendcmd;" + boat['id'] + ";" + cmd);
|
||||
|
||||
conn.send(passEl.value + ";sendcmd;" + boat['id'] + ";servotrim:0");
|
||||
conn.send(passEl.value + ";sendcmd;" + boat['id'] + ";servotrim:1");
|
||||
|
||||
}
|
||||
|
||||
function reqBoats()
|
||||
{
|
||||
conn.send(passEl.value + ";boats");
|
||||
}
|
||||
|
||||
function reqLockedBoats()
|
||||
{
|
||||
conn.send(passEl.value + ";locked");
|
||||
}
|
||||
|
||||
function reqClients()
|
||||
{
|
||||
conn.send(passEl.value + ";clients");
|
||||
}
|
||||
|
||||
function addBoats(boats)
|
||||
{
|
||||
if (boats == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
boats = boats.split(':');
|
||||
for (let boat in boats)
|
||||
{
|
||||
@@ -106,12 +244,43 @@
|
||||
boat = boat.split(';')
|
||||
if (boat.length == 3)
|
||||
{
|
||||
let boatEl = document.createElement("div");
|
||||
boatEl.className = "boat";
|
||||
boatEl.dataset['id'] = boat[0];
|
||||
boatEl.dataset['availible'] = boat[2];
|
||||
boatEl.innerText = boat[1];
|
||||
boatjesEl.append(boatEl);
|
||||
let boatRow = document.createElement("tr");
|
||||
boatRow.className = "boat";
|
||||
boatRow.dataset['id'] = boat[0];
|
||||
boatRow.dataset['name'] = boat[1];
|
||||
boatRow.dataset['state'] = boat[2];
|
||||
let boatCells = [
|
||||
document.createElement("td"),
|
||||
document.createElement("td"),
|
||||
document.createElement("td"),
|
||||
document.createElement("td")
|
||||
]
|
||||
boatCells[0].innerText = boat[0];
|
||||
boatCells[1].innerText = boat[1];
|
||||
boatCells[2].innerText = boat[2];
|
||||
let lockBtn = document.createElement("div");
|
||||
lockBtn.className = "btn";
|
||||
lockBtn.innerHTML = lockIcon;
|
||||
lockBtn.ariaLabel = "lock";
|
||||
lockBtn.addEventListener('click', lockBoat);
|
||||
boatCells[3].append(lockBtn);
|
||||
let freeBtn = document.createElement("div");
|
||||
freeBtn.className = "btn";
|
||||
freeBtn.innerHTML = freeIcon;
|
||||
lockBtn.ariaLabel = "free";
|
||||
freeBtn.addEventListener('click', freeBoat);
|
||||
boatCells[3].append(freeBtn);
|
||||
let logBtn = document.createElement("div");
|
||||
logBtn.className = "btn";
|
||||
logBtn.innerHTML = logIcon;
|
||||
lockBtn.ariaLabel = "view log";
|
||||
logBtn.addEventListener('click', getBoatLog);
|
||||
boatCells[3].append(logBtn);
|
||||
for (cell in boatCells)
|
||||
{
|
||||
boatRow.append(boatCells[cell]);
|
||||
}
|
||||
boatjesEl.append(boatRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -121,6 +290,7 @@
|
||||
|
||||
function addClients(clients)
|
||||
{
|
||||
clientsEl.innerHTML = "";
|
||||
clients = clients.split(':');
|
||||
for (let client in clients)
|
||||
{
|
||||
@@ -134,19 +304,38 @@
|
||||
function addClient(client)
|
||||
{
|
||||
client = client.split(';')
|
||||
if (client.length == 2)
|
||||
if (client.length == 3)
|
||||
{
|
||||
let clientEl = document.createElement("div");
|
||||
clientEl.className = "client";
|
||||
clientEl.dataset['id'] = client[0];
|
||||
clientEl.innerText = client[0] + " controlls " + client[1];
|
||||
clientsEl.append(clientEl);
|
||||
let clientRow = document.createElement("tr");
|
||||
clientRow.className = "client";
|
||||
clientRow.dataset['id'] = client[0];
|
||||
clientRow.dataset['boat'] = client[1];
|
||||
clientRow.dataset['state'] = client[2];
|
||||
let clientCells = [
|
||||
document.createElement("td"),
|
||||
document.createElement("td"),
|
||||
document.createElement("td"),
|
||||
document.createElement("td")
|
||||
]
|
||||
clientCells[0].innerText = client[0];
|
||||
clientCells[1].innerText = client[1];
|
||||
clientCells[2].innerText = client[2];
|
||||
let kickBtn = document.createElement("div");
|
||||
kickBtn.className = "btn";
|
||||
kickBtn.innerHTML = kickIcon;
|
||||
kickBtn.addEventListener('click', kickClient);
|
||||
clientCells[3].append(kickBtn);
|
||||
for (cell in clientCells)
|
||||
{
|
||||
clientRow.append(clientCells[cell]);
|
||||
}
|
||||
clientsEl.append(clientRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.warn("addBoat(): incorect number of args (" + client.length.toString() + "; " + client.toString() + ")");
|
||||
console.warn("addClient(): incorect number of args (" + client.length.toString() + "; " + client.toString() + ")");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,179 +1,280 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import asyncio
|
||||
import websockets
|
||||
from websockets.server import serve
|
||||
from datetime import datetime
|
||||
import json
|
||||
|
||||
adminId = "1234"
|
||||
ADMIN_ID = "1234"
|
||||
BOAT_DATA_INTERVAL_MAX = 0.1 # seconds
|
||||
|
||||
BOAT_STATE_INCTRL = 1
|
||||
BOAT_STATE_AVAILABLE = 0
|
||||
BOAT_STATE_LOCKED = -1
|
||||
BOAT_STATE_INCTRL = 2
|
||||
BOAT_STATE_AVAILABLE = 1
|
||||
BOAT_STATE_LOCKED = 0
|
||||
BOAT_STATE_TERMINATED = -1
|
||||
BOAT_STATE_DELETE = -2
|
||||
|
||||
boats = []
|
||||
clients = []
|
||||
Boats = []
|
||||
Clients = []
|
||||
|
||||
def onCMD(data):
|
||||
global boats, adminId
|
||||
print("command:" + str(data))
|
||||
if (len(data) != 4):
|
||||
return
|
||||
if (data[1] != adminId):
|
||||
return
|
||||
boot = int(data[2])
|
||||
if (boot >= 0 and boot <= 3):
|
||||
boats[boot] = data[3]
|
||||
print(boats)
|
||||
def client_disconnect(client):
|
||||
if client['state'] != 'kicked':
|
||||
client['state'] = 'del'
|
||||
if client['boat'] is not None:
|
||||
client['boat']['state'] = BOAT_STATE_AVAILABLE
|
||||
client['boat'] = None
|
||||
for i, cli in enumerate(Clients):
|
||||
if cli['state'] == 'del':
|
||||
del Clients[i]
|
||||
|
||||
def sendData(data):
|
||||
global boats
|
||||
print("data to send: " + str(data))
|
||||
def boat_disconnect(boat):
|
||||
boat['state'] = BOAT_STATE_DELETE
|
||||
for i, cli in enumerate(Boats):
|
||||
if cli['state'] == BOAT_STATE_DELETE:
|
||||
del Boats[i]
|
||||
|
||||
async def echoBoats(client):
|
||||
global boats
|
||||
async def sendToClient(client, msg):
|
||||
try:
|
||||
await client['ws'].send(msg)
|
||||
except websockets.exceptions.ConnectionClosed:
|
||||
client_disconnect(client)
|
||||
|
||||
async def sendToBoat(boat, cmd):
|
||||
boat['log'].append({"t": datetime.timestamp(datetime.now()), "type": "tx", "msg": cmd})
|
||||
await boat['ws'].send(cmd)
|
||||
|
||||
async def echo_boats(client):
|
||||
"""echo list of all not locked boats to client"""
|
||||
data = "boats:"
|
||||
for boat in boats:
|
||||
if (boat['state'] != BOAT_STATE_LOCKED):
|
||||
data += str(boat['id']) + ";" + str(boat['name']) + ";"
|
||||
if (boat["state"] == BOAT_STATE_AVAILABLE):
|
||||
data += 'available:'
|
||||
elif (boat["state"] == BOAT_STATE_INCTRL):
|
||||
data += 'inctrl:'
|
||||
await client['ws'].send(data)
|
||||
if client['state'] != "kicked":
|
||||
for boat in Boats:
|
||||
if boat['state'] != BOAT_STATE_LOCKED and boat['state'] != BOAT_STATE_TERMINATED:
|
||||
data += str(boat['id']) + ";" + str(boat['name']) + ";"
|
||||
if boat["state"] == BOAT_STATE_AVAILABLE:
|
||||
data += 'available:'
|
||||
elif boat["state"] == BOAT_STATE_INCTRL:
|
||||
data += 'inctrl:'
|
||||
await sendToClient(client, data)
|
||||
|
||||
async def echoLockedBoats(client):
|
||||
global boats
|
||||
if (client['id'] == adminId):
|
||||
async def echo_locked_boats(client):
|
||||
"""echo list of all locked boats to client"""
|
||||
if client['id'] == ADMIN_ID:
|
||||
data = "lockedBoats:"
|
||||
for boat in boats:
|
||||
if (boat['state'] == BOAT_STATE_LOCKED):
|
||||
for boat in Boats:
|
||||
if boat['state'] == BOAT_STATE_LOCKED:
|
||||
data += str(boat['id']) + ";" + str(boat['name']) + ";locked:"
|
||||
await client['ws'].send(data + '\n')
|
||||
await sendToClient(client, data)
|
||||
|
||||
async def echoClients(client):
|
||||
global clients
|
||||
if (client['id'] == adminId):
|
||||
async def echo_clients(client):
|
||||
"""echo list of all clients to client"""
|
||||
if client['id'] == ADMIN_ID:
|
||||
data = "clients:"
|
||||
for client in clients:
|
||||
data += str(client['id']) + ";" + str(client['boat']) + ";" + str(client['state']) + ":"
|
||||
await client['ws'].send(data + '\n')
|
||||
for clie in Clients:
|
||||
clientId = clie['id']
|
||||
if (clie['id'] == ADMIN_ID):
|
||||
clientId = "admin"
|
||||
boatId = "----"
|
||||
if (clie['boat'] is not None):
|
||||
boatId = clie['boat']['id']
|
||||
data += clientId + ";" + boatId + ";" + str(clie['state']) + ":"
|
||||
await sendToClient(client, data)
|
||||
|
||||
async def takeControll(client, boat):
|
||||
global boats
|
||||
if (client['boat'] is not None):
|
||||
boat["state"] = BOAT_STATE_AVAILABLE
|
||||
async def take_controll(client, boat):
|
||||
"""let a client take controll a boat"""
|
||||
if client['boat'] is not None:
|
||||
client['boat']["state"] = BOAT_STATE_AVAILABLE
|
||||
client["boat"] = None
|
||||
for b in boats:
|
||||
if (b['id'] == int(boat)):
|
||||
if (boat['state'] == BOAT_STATE_AVAILABLE):
|
||||
boat["state"] = BOAT_STATE_INCTRL
|
||||
print("take controll: " + str(client["id"]) + " -> " + boat["name"])
|
||||
for b in Boats:
|
||||
if b['id'] == boat and b['state'] != BOAT_STATE_TERMINATED:
|
||||
if b['state'] == BOAT_STATE_AVAILABLE:
|
||||
b["state"] = BOAT_STATE_INCTRL
|
||||
print("take controll: " + str(client["id"]) + " -> " + b["name"])
|
||||
client["boat"] = b
|
||||
await sendToClient(client, "OK")
|
||||
return
|
||||
else:
|
||||
print("WARN: takeControll: " + boat["name"] + " not available (" + str(client["id"]) + ")")
|
||||
break
|
||||
await sendToClient(client, "FAIL")
|
||||
|
||||
async def freeBoat(boat):
|
||||
global boats, clients
|
||||
for client in clients:
|
||||
if (client["boat"]['id'] == boat):
|
||||
async def free_boat(boat):
|
||||
"""make boat available for next client"""
|
||||
for client in Clients:
|
||||
if client["boat"] is not None and client["boat"]['id'] == boat:
|
||||
client["boat"] = None
|
||||
await sendToClient(client, "FAIL")
|
||||
break
|
||||
for b in boats:
|
||||
if (b['id'] == int(boat)):
|
||||
if (boat['state'] == BOAT_STATE_INCTRL):
|
||||
boat["state"] = BOAT_STATE_AVAILABLE
|
||||
for b in Boats:
|
||||
if b['id'] == boat and b['state'] != BOAT_STATE_TERMINATED:
|
||||
b["state"] = BOAT_STATE_AVAILABLE
|
||||
break
|
||||
|
||||
async def lockBoat(boat):
|
||||
global boats, clients
|
||||
for client in clients:
|
||||
if (client["boat"]['id'] == boat):
|
||||
async def lock_boat(boat):
|
||||
"""lock a boat so client can't take controll over it"""
|
||||
for client in Clients:
|
||||
if client["boat"] is not None and client["boat"]['id'] == boat:
|
||||
client["boat"] = None
|
||||
await sendToClient(client, "FAIL")
|
||||
break
|
||||
for b in boats:
|
||||
if (b['id'] == int(boat)):
|
||||
boat["state"] = BOAT_STATE_LOCKED
|
||||
for b in Boats:
|
||||
if b['id'] == boat and b['state'] != BOAT_STATE_TERMINATED:
|
||||
b["state"] = BOAT_STATE_LOCKED
|
||||
break
|
||||
|
||||
|
||||
|
||||
async def onMessage(message, client):
|
||||
global boats
|
||||
async def getlog(client, data):
|
||||
"""send boat log to client"""
|
||||
for b in Boats:
|
||||
if b['id'] == data[2]:
|
||||
await sendToClient(client, "log;" + b['id'] + ";" + json.dumps(b['log']))
|
||||
return
|
||||
|
||||
async def sendcmd(data):
|
||||
"""send command to boat"""
|
||||
if len(data) > 3:
|
||||
for b in Boats:
|
||||
if b['id'] == data[2]:
|
||||
del data[2]
|
||||
del data[1]
|
||||
del data[0]
|
||||
print(data)
|
||||
data = ";".join(data)
|
||||
await sendToBoat(b, data + "\n")
|
||||
return
|
||||
|
||||
async def kick_client(clientId):
|
||||
"""kick a client"""
|
||||
for client in Clients:
|
||||
if client['id'] == client and client['state'] != "terminated":
|
||||
if client['boat'] is not None:
|
||||
client['boat']['state'] = BOAT_STATE_AVAILABLE
|
||||
client['boat'] = None
|
||||
client['state'] = "kicked"
|
||||
await client['ws'].send("FAIL")
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
async def on_message(message, client):
|
||||
"""handel for client messages"""
|
||||
data = message.replace('\n', '').split(';')
|
||||
if(data[0] != client["id"]):
|
||||
if data[0] != client["id"]:
|
||||
print("invalid id: " + str(data[0]) + " != " + str(client["id"]))
|
||||
else:
|
||||
if (data[1] == "boats"):
|
||||
await echoBoats(client)
|
||||
elif(data[1] == "ctrl"):
|
||||
takeControll(client, data[2])
|
||||
elif(data[1] == "end"):
|
||||
takeControll(client, -1)
|
||||
elif(data[1] == "free"):
|
||||
if (client["id"] == adminId):
|
||||
freeBoat(data[2])
|
||||
elif(data[1] == "lock"):
|
||||
if (client["id"] == adminId):
|
||||
lockBoat(data[2])
|
||||
elif(data[1] == "locked"):
|
||||
await echoLockedBoats(client)
|
||||
elif(data[1] == "kick"):
|
||||
print("kick")
|
||||
elif(data[1] == "clients"):
|
||||
await echoClients(client)
|
||||
elif(data[1] == "d"):
|
||||
if (client['boat'] is None):
|
||||
elif len(data) >= 2:
|
||||
if data[1] == "boats":
|
||||
await echo_boats(client)
|
||||
elif data[1] == "ctrl":
|
||||
await take_controll(client, data[2])
|
||||
elif data[1] == "end":
|
||||
await take_controll(client, "noBoat")
|
||||
elif data[1] == "free" and client["id"] == ADMIN_ID:
|
||||
await free_boat(data[2])
|
||||
elif data[1] == "lock" and client["id"] == ADMIN_ID:
|
||||
await lock_boat(data[2])
|
||||
elif data[1] == "locked" and client["id"] == ADMIN_ID:
|
||||
await echo_locked_boats(client)
|
||||
elif data[1] == "kick" and client["id"] == ADMIN_ID:
|
||||
await kick_client(data[2])
|
||||
elif data[1] == "clients":
|
||||
await echo_clients(client)
|
||||
elif data[1] == "d":
|
||||
if client['boat'] is None:
|
||||
print("WARN: controll cmd (" + client['id'] + ") to None: " + data[2])
|
||||
else:
|
||||
print("INFO: controll cmd (" + client['id'] + ") to " + client['boat']['name'] + ": " + data[2])
|
||||
await client['ws'].send("FAIL")
|
||||
elif client['boat']['lastMsg'] + BOAT_DATA_INTERVAL_MAX < datetime.timestamp(datetime.now()):
|
||||
# print("INFO: controll cmd (" + client['id'] + ") to " + client['boat']['name'] + ": " + data[2])
|
||||
await sendToBoat(client['boat'], "d:" + data[2] + "\n")
|
||||
client['boat']['lastMsg'] = datetime.timestamp(datetime.now())
|
||||
elif data[1] == "getlog" and client['id'] == ADMIN_ID:
|
||||
await getlog(client, data)
|
||||
elif data[1] == "sendcmd" and client['id'] == ADMIN_ID:
|
||||
await sendcmd(data)
|
||||
elif client['id'] == ADMIN_ID:
|
||||
print("WARN: invalid command (admin): '" + data[1] + "'")
|
||||
else:
|
||||
print("WARN: invalid command (" + client['id'] + "): '" + data[1] + "'")
|
||||
else:
|
||||
print("WARN: to little arguments")
|
||||
|
||||
async def newClient(clientId, ws):
|
||||
async def new_client(clientId, ws):
|
||||
"""handler for every new client connection"""
|
||||
client = { "id": clientId, "boat": None, "ws": ws, "state": "active" }
|
||||
print("new client connected: " + client['id'])
|
||||
for clie in clients:
|
||||
if (clie['id'] == client['id']):
|
||||
if client['id'] == ADMIN_ID:
|
||||
print("INFO: new client connected: admin")
|
||||
else:
|
||||
print("INFO: new client connected: " + client['id'])
|
||||
for clie in Clients:
|
||||
if clie['id'] == client['id']:
|
||||
if client['state'] == "kicked":
|
||||
client['state'] = "kicked"
|
||||
clie['state'] = 'terminated'
|
||||
clients.append(client)
|
||||
if (client['id'] == adminId):
|
||||
await echoBoats(client)
|
||||
await echoLockedBoats(client)
|
||||
await echoClients(client)
|
||||
Clients.append(client)
|
||||
return client
|
||||
|
||||
async def newBoat(boatId, name, ws):
|
||||
boat = { "id": boatId, "name": name, "ws": ws, "state": BOAT_STATE_AVAILABLE }
|
||||
print("new boat connected: " + boatId)
|
||||
for bo in boats:
|
||||
if (bo['id'] == boat['id']):
|
||||
bo['state'] = 'terminated'
|
||||
boats.append(boat)
|
||||
async def new_boat(boatId, name, ws):
|
||||
"""handler for every new boat connection"""
|
||||
boat = { "id": boatId, "name": name, "ws": ws, "state": BOAT_STATE_AVAILABLE, "lastMsg": 0, "log": [] }
|
||||
print("INFO: new boat connected: " + boatId)
|
||||
for i, bo in enumerate(Boats):
|
||||
if bo['id'] == boat['id']:
|
||||
bo['state'] = BOAT_STATE_TERMINATED
|
||||
# await bo['ws'].close()
|
||||
# del Boats[i]
|
||||
Boats.append(boat)
|
||||
return boat
|
||||
|
||||
async def run(ws, path):
|
||||
"""hadeler for every new websocket connection"""
|
||||
client = None
|
||||
async for message in ws:
|
||||
message = message.split(';')
|
||||
if (len(message) == 3 and message[1] == "4675"):
|
||||
client = await newClient(message[0], ws)
|
||||
if (client is not None):
|
||||
break
|
||||
elif (len(message) == 3 and message[1] == "3440"):
|
||||
client = await newBoat(message[0], message[2], ws)
|
||||
if (client is not None):
|
||||
break
|
||||
|
||||
async for message in ws:
|
||||
if (client['state'] == 'active'):
|
||||
await onMessage(message, client)
|
||||
else:
|
||||
break
|
||||
try:
|
||||
print("INFO: new connection")
|
||||
async for msg in ws:
|
||||
for message in msg.split("\n"):
|
||||
if len(message) == 0:
|
||||
continue
|
||||
message = message.split(';')
|
||||
if len(message) == 3 and message[1] == "4675":
|
||||
client = await new_client(message[0], ws)
|
||||
if client is not None:
|
||||
try:
|
||||
async for msg in ws:
|
||||
for message in msg.split("\n"):
|
||||
if len(message) == 0:
|
||||
continue
|
||||
if client['state'] == 'active':
|
||||
await on_message(message, client)
|
||||
else:
|
||||
break
|
||||
except websockets.exceptions.ConnectionClosed:
|
||||
print("INFO: client " + client['id'] + ": execption")
|
||||
print("INFO: client " + client['id'] + ": disconnected")
|
||||
client_disconnect(client)
|
||||
break
|
||||
elif (len(message) == 3 and message[1] == "3440"):
|
||||
client = await new_boat(message[0], message[2], ws)
|
||||
if client is not None:
|
||||
try:
|
||||
async for msg in ws:
|
||||
for message in msg.split("\n"):
|
||||
if len(message) == 0:
|
||||
continue
|
||||
print("boat" + client['id'] + " says '" + message + "'")
|
||||
client['log'].append({
|
||||
"t": datetime.timestamp(datetime.now()),
|
||||
"type": "rx",
|
||||
"msg": message
|
||||
})
|
||||
except websockets.exceptions.ConnectionClosed:
|
||||
print("INFO: boat " + client['id'] + ": execption")
|
||||
print("INFO: boat " + client['id'] + ": disconnected")
|
||||
boat_disconnect(client)
|
||||
break
|
||||
except websockets.exceptions.ConnectionClosed:
|
||||
print("WARN: connection disconected")
|
||||
|
||||
async def main():
|
||||
"""main"""
|
||||
async with serve(run, "0.0.0.0", 8080):
|
||||
await asyncio.Future()
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
|
||||
91
index.html
91
index.html
@@ -29,71 +29,108 @@
|
||||
var boatListEl = document.getElementById('boats');
|
||||
var stickEl = document.getElementById('canvas');
|
||||
|
||||
var connection = new WebSocket('ws://' + "10.254.0.1" + ':8080/', ['mbcRcRf']);
|
||||
var connection = false;
|
||||
var refresh_timer = false;
|
||||
var state = "connecting";
|
||||
|
||||
connection.onopen = function ()
|
||||
function conn_onopen()
|
||||
{
|
||||
connection.send(clientId + ';4675;' + Math.floor(new Date().getTime()/1000.0).toString());
|
||||
setTimeout(() => { connection.send(clientId + ';boats'); }, 100);
|
||||
state = "connected";
|
||||
};
|
||||
|
||||
connection.onerror = function (error)
|
||||
function conn_onerror(error)
|
||||
{
|
||||
console.log('WebSocket Error ', error);
|
||||
alert('WebSocket Error ', error);
|
||||
|
||||
//connection.onmessage({ data: "boats:50;test 1;available:164;tosti;available" })
|
||||
};
|
||||
|
||||
connection.onmessage = function (e)
|
||||
function conn_onmessage(e)
|
||||
{
|
||||
let data = e.data.split(':');
|
||||
if (data[0] == "boats")
|
||||
{
|
||||
console.log("boats: ", data);
|
||||
boatListEl.innerHTML = "";
|
||||
stickEl.style.display = 'none';
|
||||
boatListEl.style.display = 'block';
|
||||
for (let boat in data)
|
||||
if (state == 'connected')
|
||||
{
|
||||
boat = data[boat].split(';');
|
||||
if ((boat.length == 3) && (boat[2] == 'available'))
|
||||
console.log("boats: ", data);
|
||||
boatListEl.innerHTML = "";
|
||||
stickEl.style.display = 'none';
|
||||
boatListEl.style.display = 'block';
|
||||
for (let boat in data)
|
||||
{
|
||||
console.log("render boat", boat);
|
||||
let el = document.createElement("div");
|
||||
el.style.textAlign = "center";
|
||||
el.style.borderRadius = "10px";
|
||||
el.style.backgroundColor = "#242495";
|
||||
el.style.padding = "10px";
|
||||
el.style.margin = "5px 25%";
|
||||
el.style.color = "white";
|
||||
el.style.cursor = "pointer";
|
||||
el.id = "boat" + boat[0];
|
||||
el.innerHTML = boat[1];
|
||||
el.addEventListener('click', selectBoat);
|
||||
boatListEl.appendChild(el);
|
||||
boat = data[boat].split(';');
|
||||
if ((boat.length == 3) && (boat[2] == 'available'))
|
||||
{
|
||||
console.log("render boat", boat);
|
||||
let el = document.createElement("div");
|
||||
el.style.textAlign = "center";
|
||||
el.style.borderRadius = "10px";
|
||||
el.style.padding = "10px";
|
||||
el.style.margin = "5px 25%";
|
||||
if (boat[2] == 'available')
|
||||
{
|
||||
el.style.backgroundColor = "#242495";
|
||||
el.style.color = "white";
|
||||
el.style.cursor = "pointer";
|
||||
el.addEventListener('click', selectBoat);
|
||||
}
|
||||
else
|
||||
{
|
||||
el.style.backgroundColor = "#CCCCCC";
|
||||
el.style.color = "black";
|
||||
el.style.cursor = "not-allowed";
|
||||
}
|
||||
el.id = "boat" + boat[0];
|
||||
el.innerHTML = boat[1];
|
||||
boatListEl.appendChild(el);
|
||||
}
|
||||
}
|
||||
if (refresh_timer)
|
||||
{
|
||||
clearTimeout(refresh_timer);
|
||||
}
|
||||
refresh_timer = setTimeout(()=>{connection.send(clientId + ';boats')}, 1000)
|
||||
}
|
||||
}
|
||||
else if (data[0] == "FAIL")
|
||||
{
|
||||
console.error("ground station send FAIL");
|
||||
connection.send(clientId + ';boats');
|
||||
state = "connected";
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('Server: ', e.data);
|
||||
}
|
||||
};
|
||||
|
||||
function connect()
|
||||
{
|
||||
connection = new WebSocket('ws://10.254.0.1:8080/', ['mbcRcRf']);
|
||||
connection.onopen = conn_onopen;
|
||||
connection.onerror = conn_onerror;
|
||||
connection.onmessage = conn_onmessage;
|
||||
}
|
||||
|
||||
function selectBoat(e)
|
||||
{
|
||||
clearTimeout(refresh_timer);
|
||||
connection.send(clientId + ';ctrl;' + e.target.id.split('boat')[1]);
|
||||
console.log('ctrl:', e.target.id.split('boat')[1]);
|
||||
stickEl.style.display = 'block';
|
||||
boatListEl.style.display = 'none';
|
||||
}
|
||||
|
||||
function send(x,y,angle){
|
||||
factor = (2**8-1)/400;
|
||||
x = Math.round((x + 200) * factor);
|
||||
y = Math.round((y + 200) * factor);
|
||||
var data = clientId + ";d;" + x.toString() + "," + y.toString();
|
||||
connection.send(data);
|
||||
}
|
||||
|
||||
|
||||
connect();
|
||||
</script>
|
||||
<script>
|
||||
var canvas, ctx;
|
||||
|
||||
24
plot.sh
Executable file
24
plot.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
function sample() {
|
||||
sigrok-cli -d fx2lafw:conn=1.13 --config 'samplerate=1 MHz' -C D5,D7 --time 400ms -P servo:data=D5 -P servo:data=D7
|
||||
}
|
||||
|
||||
samples=$(sample | head -n2 | sed -e 's/servo-[12]: //')
|
||||
|
||||
cha=$(echo "$samples" | head -n1)
|
||||
cha_c=$(( ( `echo $cha | tr -d '.'` - 1000 ) / 10 ))
|
||||
chb=$(echo "$samples" | tail -n1)
|
||||
chb_c=$(( ( `echo $chb | tr -d '.'` - 1000 ) / 10 ))
|
||||
|
||||
echo -n " |"
|
||||
printf "%0.s " $(seq 1 49)
|
||||
echo -n "|"
|
||||
printf "%0.s " $(seq 1 49)
|
||||
echo "|"
|
||||
echo -n "A: $cha "
|
||||
printf "%0.s#" $(seq 1 $cha_c)
|
||||
echo
|
||||
echo -n "B: $chb "
|
||||
printf "%0.s#" $(seq 1 $chb_c)
|
||||
echo
|
||||
15
rcrf-gs.service
Normal file
15
rcrf-gs.service
Normal file
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=rcrf ground station
|
||||
After=network-online.target
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
RemainAfterExit=yes
|
||||
WorkingDirectory=/opt/rcrf-wifi
|
||||
ExecStart=/usr/bin/python3 /opt/rcrf-wifi/ground-station.py
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
7
rx_esp32/.gitignore
vendored
7
rx_esp32/.gitignore
vendored
@@ -5,4 +5,9 @@
|
||||
.vscode/ipch
|
||||
|
||||
build
|
||||
.cache
|
||||
.cache
|
||||
|
||||
/sdkconfig
|
||||
/dependencies.lock
|
||||
/src/config.h
|
||||
*.old
|
||||
|
||||
@@ -3,7 +3,7 @@ dependencies:
|
||||
component_hash: null
|
||||
source:
|
||||
type: idf
|
||||
version: 5.4.0
|
||||
version: 5.3.0
|
||||
manifest_hash: 0646c148cf0e35f84678cd2cb46e9929051a1c6db31905f3a584cca01fd1e49a
|
||||
target: esp32c3
|
||||
target: {{ IC }}
|
||||
version: 1.0.0
|
||||
Submodule rx_esp32/lib/cli updated: ae59563e7d...8204cb0865
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file. DO NOT EDIT.
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.2.2 Project Configuration
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.3.0 Project Configuration
|
||||
#
|
||||
CONFIG_SOC_ADC_SUPPORTED=y
|
||||
CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y
|
||||
@@ -14,6 +14,7 @@ CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y
|
||||
CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y
|
||||
CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y
|
||||
CONFIG_SOC_XT_WDT_SUPPORTED=y
|
||||
CONFIG_SOC_PHY_SUPPORTED=y
|
||||
CONFIG_SOC_WIFI_SUPPORTED=y
|
||||
CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y
|
||||
CONFIG_SOC_EFUSE_KEY_PURPOSE_FIELD=y
|
||||
@@ -42,6 +43,11 @@ CONFIG_SOC_CLK_TREE_SUPPORTED=y
|
||||
CONFIG_SOC_ASSIST_DEBUG_SUPPORTED=y
|
||||
CONFIG_SOC_WDT_SUPPORTED=y
|
||||
CONFIG_SOC_SPI_FLASH_SUPPORTED=y
|
||||
CONFIG_SOC_RNG_SUPPORTED=y
|
||||
CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y
|
||||
CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y
|
||||
CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y
|
||||
CONFIG_SOC_PM_SUPPORTED=y
|
||||
CONFIG_SOC_XTAL_SUPPORT_40M=y
|
||||
CONFIG_SOC_AES_SUPPORT_DMA=y
|
||||
CONFIG_SOC_AES_GDMA=y
|
||||
@@ -77,6 +83,7 @@ CONFIG_SOC_CACHE_MEMORY_IBANK_SIZE=0x4000
|
||||
CONFIG_SOC_CPU_CORES_NUM=1
|
||||
CONFIG_SOC_CPU_INTR_NUM=32
|
||||
CONFIG_SOC_CPU_HAS_FLEXIBLE_INTC=y
|
||||
CONFIG_SOC_CPU_HAS_CSR_PC=y
|
||||
CONFIG_SOC_CPU_BREAKPOINTS_NUM=8
|
||||
CONFIG_SOC_CPU_WATCHPOINTS_NUM=8
|
||||
CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x80000000
|
||||
@@ -95,12 +102,15 @@ CONFIG_SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP=y
|
||||
CONFIG_SOC_GPIO_IN_RANGE_MAX=21
|
||||
CONFIG_SOC_GPIO_OUT_RANGE_MAX=21
|
||||
CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK=0
|
||||
CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT=6
|
||||
CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x00000000003FFFC0
|
||||
CONFIG_SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX=y
|
||||
CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3
|
||||
CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8
|
||||
CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8
|
||||
CONFIG_SOC_DEDIC_PERIPH_ALWAYS_ENABLE=y
|
||||
CONFIG_SOC_I2C_NUM=1
|
||||
CONFIG_SOC_HP_I2C_NUM=1
|
||||
CONFIG_SOC_I2C_FIFO_LEN=32
|
||||
CONFIG_SOC_I2C_CMD_REG_NUM=8
|
||||
CONFIG_SOC_I2C_SUPPORT_SLAVE=y
|
||||
@@ -145,6 +155,8 @@ CONFIG_SOC_RMT_SUPPORT_APB=y
|
||||
CONFIG_SOC_RMT_SUPPORT_RC_FAST=y
|
||||
CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128
|
||||
CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=108
|
||||
CONFIG_SOC_SLEEP_SYSTIMER_STALL_WORKAROUND=y
|
||||
CONFIG_SOC_SLEEP_TGWDT_STOP_WORKAROUND=y
|
||||
CONFIG_SOC_RTCIO_PIN_COUNT=0
|
||||
CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4
|
||||
CONFIG_SOC_MPI_OPERATIONS_NUM=3
|
||||
@@ -170,6 +182,10 @@ CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y
|
||||
CONFIG_SOC_SPI_SUPPORT_CLK_APB=y
|
||||
CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y
|
||||
CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y
|
||||
CONFIG_SOC_SPI_SCT_SUPPORTED=y
|
||||
CONFIG_SOC_SPI_SCT_REG_NUM=14
|
||||
CONFIG_SOC_SPI_SCT_BUFFER_NUM_MAX=y
|
||||
CONFIG_SOC_SPI_SCT_CONF_BITLEN_MAX=0x3FFFA
|
||||
CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y
|
||||
CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16
|
||||
CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y
|
||||
@@ -267,7 +283,7 @@ CONFIG_IDF_TOOLCHAIN="gcc"
|
||||
CONFIG_IDF_TARGET_ARCH_RISCV=y
|
||||
CONFIG_IDF_TARGET_ARCH="riscv"
|
||||
CONFIG_IDF_TARGET="esp32c3"
|
||||
CONFIG_IDF_INIT_VERSION="5.2.2"
|
||||
CONFIG_IDF_INIT_VERSION="5.3.0"
|
||||
CONFIG_IDF_TARGET_ESP32C3=y
|
||||
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005
|
||||
|
||||
@@ -363,10 +379,15 @@ CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y
|
||||
CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y
|
||||
CONFIG_ESP_ROM_HAS_SPI_FLASH=y
|
||||
CONFIG_ESP_ROM_HAS_ETS_PRINTF_BUG=y
|
||||
CONFIG_ESP_ROM_HAS_NEWLIB=y
|
||||
CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y
|
||||
CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y
|
||||
CONFIG_ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE=y
|
||||
CONFIG_ESP_ROM_RAM_APP_NEEDS_MMU_INIT=y
|
||||
CONFIG_ESP_ROM_HAS_SW_FLOAT=y
|
||||
CONFIG_ESP_ROM_USB_OTG_NUM=-1
|
||||
CONFIG_ESP_ROM_HAS_VERSION=y
|
||||
CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y
|
||||
|
||||
#
|
||||
# Boot ROM Behavior
|
||||
@@ -452,6 +473,8 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
|
||||
# CONFIG_COMPILER_DUMP_RTL_FILES is not set
|
||||
CONFIG_COMPILER_RT_LIB_GCCLIB=y
|
||||
CONFIG_COMPILER_RT_LIB_NAME="gcc"
|
||||
# CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING is not set
|
||||
CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y
|
||||
# end of Compiler options
|
||||
|
||||
#
|
||||
@@ -477,31 +500,16 @@ CONFIG_APPTRACE_LOCK_ENABLE=y
|
||||
CONFIG_BT_ALARM_MAX_NUM=50
|
||||
# end of Bluetooth
|
||||
|
||||
#
|
||||
# Console Library
|
||||
#
|
||||
# CONFIG_CONSOLE_SORTED_HELP is not set
|
||||
# end of Console Library
|
||||
|
||||
#
|
||||
# Driver Configurations
|
||||
#
|
||||
|
||||
#
|
||||
# Legacy ADC Configuration
|
||||
#
|
||||
# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
|
||||
|
||||
#
|
||||
# Legacy ADC Calibration Configuration
|
||||
#
|
||||
# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy ADC Calibration Configuration
|
||||
# end of Legacy ADC Configuration
|
||||
|
||||
#
|
||||
# SPI Configuration
|
||||
#
|
||||
# CONFIG_SPI_MASTER_IN_IRAM is not set
|
||||
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
|
||||
# CONFIG_SPI_SLAVE_IN_IRAM is not set
|
||||
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
||||
# end of SPI Configuration
|
||||
|
||||
#
|
||||
# TWAI Configuration
|
||||
#
|
||||
@@ -510,76 +518,46 @@ CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y
|
||||
# end of TWAI Configuration
|
||||
|
||||
#
|
||||
# Temperature sensor Configuration
|
||||
# Legacy ADC Driver Configuration
|
||||
#
|
||||
# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
|
||||
|
||||
#
|
||||
# Legacy ADC Calibration Configuration
|
||||
#
|
||||
# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy ADC Calibration Configuration
|
||||
# end of Legacy ADC Driver Configuration
|
||||
|
||||
#
|
||||
# Legacy Timer Group Driver Configurations
|
||||
#
|
||||
# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy Timer Group Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy RMT Driver Configurations
|
||||
#
|
||||
# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy RMT Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy I2S Driver Configurations
|
||||
#
|
||||
# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy I2S Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy SDM Driver Configurations
|
||||
#
|
||||
# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy SDM Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy Temperature Sensor Driver Configurations
|
||||
#
|
||||
# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set
|
||||
# end of Temperature sensor Configuration
|
||||
|
||||
#
|
||||
# UART Configuration
|
||||
#
|
||||
# CONFIG_UART_ISR_IN_IRAM is not set
|
||||
# end of UART Configuration
|
||||
|
||||
#
|
||||
# GPIO Configuration
|
||||
#
|
||||
# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of GPIO Configuration
|
||||
|
||||
#
|
||||
# Sigma Delta Modulator Configuration
|
||||
#
|
||||
# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_SDM_ENABLE_DEBUG_LOG is not set
|
||||
# end of Sigma Delta Modulator Configuration
|
||||
|
||||
#
|
||||
# GPTimer Configuration
|
||||
#
|
||||
CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y
|
||||
# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set
|
||||
# end of GPTimer Configuration
|
||||
|
||||
#
|
||||
# RMT Configuration
|
||||
#
|
||||
# CONFIG_RMT_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set
|
||||
# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_RMT_ENABLE_DEBUG_LOG is not set
|
||||
# end of RMT Configuration
|
||||
|
||||
#
|
||||
# I2S Configuration
|
||||
#
|
||||
# CONFIG_I2S_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_I2S_ENABLE_DEBUG_LOG is not set
|
||||
# end of I2S Configuration
|
||||
|
||||
#
|
||||
# USB Serial/JTAG Configuration
|
||||
#
|
||||
# end of USB Serial/JTAG Configuration
|
||||
|
||||
#
|
||||
# LEDC Configuration
|
||||
#
|
||||
# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of LEDC Configuration
|
||||
|
||||
#
|
||||
# I2C Configuration
|
||||
#
|
||||
# CONFIG_I2C_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2C_ENABLE_DEBUG_LOG is not set
|
||||
# end of I2C Configuration
|
||||
# end of Legacy Temperature Sensor Driver Configurations
|
||||
# end of Driver Configurations
|
||||
|
||||
#
|
||||
@@ -596,7 +574,9 @@ CONFIG_EFUSE_MAX_BLK_LEN=256
|
||||
CONFIG_ESP_TLS_USING_MBEDTLS=y
|
||||
CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y
|
||||
# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set
|
||||
# CONFIG_ESP_TLS_SERVER is not set
|
||||
# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set
|
||||
# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set
|
||||
# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set
|
||||
# CONFIG_ESP_TLS_PSK_VERIFICATION is not set
|
||||
# CONFIG_ESP_TLS_INSECURE is not set
|
||||
# end of ESP-TLS
|
||||
@@ -608,11 +588,13 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y
|
||||
# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set
|
||||
# CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 is not set
|
||||
# CONFIG_ADC_ENABLE_DEBUG_LOG is not set
|
||||
# end of ADC and ADC Calibration
|
||||
|
||||
#
|
||||
# Wireless Coexistence
|
||||
#
|
||||
CONFIG_ESP_COEX_ENABLED=y
|
||||
# CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set
|
||||
# end of Wireless Coexistence
|
||||
|
||||
@@ -622,6 +604,83 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y
|
||||
CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
|
||||
# end of Common ESP-related
|
||||
|
||||
#
|
||||
# ESP-Driver:GPIO Configurations
|
||||
#
|
||||
# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of ESP-Driver:GPIO Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:GPTimer Configurations
|
||||
#
|
||||
CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y
|
||||
# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:GPTimer Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:I2C Configurations
|
||||
#
|
||||
# CONFIG_I2C_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2C_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:I2C Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:I2S Configurations
|
||||
#
|
||||
# CONFIG_I2S_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2S_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:I2S Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:LEDC Configurations
|
||||
#
|
||||
# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of ESP-Driver:LEDC Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:RMT Configurations
|
||||
#
|
||||
# CONFIG_RMT_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set
|
||||
# CONFIG_RMT_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:RMT Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:Sigma Delta Modulator Configurations
|
||||
#
|
||||
# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_SDM_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:Sigma Delta Modulator Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:SPI Configurations
|
||||
#
|
||||
# CONFIG_SPI_MASTER_IN_IRAM is not set
|
||||
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
|
||||
# CONFIG_SPI_SLAVE_IN_IRAM is not set
|
||||
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
||||
# end of ESP-Driver:SPI Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:Temperature Sensor Configurations
|
||||
#
|
||||
# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:Temperature Sensor Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:UART Configurations
|
||||
#
|
||||
# CONFIG_UART_ISR_IN_IRAM is not set
|
||||
# end of ESP-Driver:UART Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:USB Serial/JTAG Configuration
|
||||
#
|
||||
CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y
|
||||
# end of ESP-Driver:USB Serial/JTAG Configuration
|
||||
|
||||
#
|
||||
# Ethernet
|
||||
#
|
||||
@@ -657,6 +716,7 @@ CONFIG_ESP_GDBSTUB_MAX_TASKS=32
|
||||
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set
|
||||
# end of ESP HTTP client
|
||||
|
||||
#
|
||||
@@ -715,6 +775,7 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y
|
||||
CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y
|
||||
CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y
|
||||
CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y
|
||||
CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4
|
||||
# CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_TWO is not set
|
||||
CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR=y
|
||||
CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES=4
|
||||
@@ -734,8 +795,6 @@ CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=0
|
||||
CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y
|
||||
# end of Sleep Config
|
||||
|
||||
CONFIG_ESP_SLEEP_SYSTIMER_STALL_WORKAROUND=y
|
||||
|
||||
#
|
||||
# RTC Clock Config
|
||||
#
|
||||
@@ -753,12 +812,12 @@ CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y
|
||||
# end of Peripheral Control
|
||||
|
||||
#
|
||||
# GDMA Configuration
|
||||
# GDMA Configurations
|
||||
#
|
||||
# CONFIG_GDMA_CTRL_FUNC_IN_IRAM is not set
|
||||
CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y
|
||||
# CONFIG_GDMA_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_GDMA_ENABLE_DEBUG_LOG is not set
|
||||
# end of GDMA Configuration
|
||||
# end of GDMA Configurations
|
||||
|
||||
#
|
||||
# Main XTAL Config
|
||||
@@ -766,6 +825,8 @@ CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y
|
||||
CONFIG_XTAL_FREQ_40=y
|
||||
CONFIG_XTAL_FREQ=40
|
||||
# end of Main XTAL Config
|
||||
|
||||
CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y
|
||||
# end of Hardware Settings
|
||||
|
||||
#
|
||||
@@ -779,7 +840,6 @@ CONFIG_XTAL_FREQ=40
|
||||
#
|
||||
# LCD Peripheral Configuration
|
||||
#
|
||||
CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32
|
||||
# CONFIG_LCD_ENABLE_DEBUG_LOG is not set
|
||||
# end of LCD Peripheral Configuration
|
||||
# end of LCD and Touch Panel
|
||||
@@ -804,6 +864,7 @@ CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y
|
||||
#
|
||||
# PHY
|
||||
#
|
||||
CONFIG_ESP_PHY_ENABLED=y
|
||||
CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y
|
||||
# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set
|
||||
CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20
|
||||
@@ -874,6 +935,7 @@ CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
|
||||
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y
|
||||
CONFIG_ESP_CONSOLE_UART=y
|
||||
CONFIG_ESP_CONSOLE_UART_NUM=0
|
||||
CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0
|
||||
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
|
||||
CONFIG_ESP_INT_WDT=y
|
||||
CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
|
||||
@@ -902,6 +964,7 @@ CONFIG_ESP_BROWNOUT_DET_LVL=7
|
||||
|
||||
CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y
|
||||
CONFIG_ESP_SYSTEM_HW_STACK_GUARD=y
|
||||
CONFIG_ESP_SYSTEM_HW_PC_RECORD=y
|
||||
# end of ESP System Settings
|
||||
|
||||
#
|
||||
@@ -911,7 +974,7 @@ CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
|
||||
# end of IPC (Inter-Processor Call)
|
||||
|
||||
#
|
||||
# High resolution timer (esp_timer)
|
||||
# ESP Timer (High Resolution Timer)
|
||||
#
|
||||
# CONFIG_ESP_TIMER_PROFILING is not set
|
||||
CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y
|
||||
@@ -921,11 +984,10 @@ CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1
|
||||
# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set
|
||||
CONFIG_ESP_TIMER_TASK_AFFINITY=0x0
|
||||
CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y
|
||||
CONFIG_ESP_TIMER_ISR_AFFINITY=0x1
|
||||
CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y
|
||||
# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set
|
||||
CONFIG_ESP_TIMER_IMPL_SYSTIMER=y
|
||||
# end of High resolution timer (esp_timer)
|
||||
# end of ESP Timer (High Resolution Timer)
|
||||
|
||||
#
|
||||
# Wi-Fi
|
||||
@@ -957,10 +1019,13 @@ CONFIG_ESP_WIFI_ENABLE_SAE_PK=y
|
||||
CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y
|
||||
# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set
|
||||
CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50
|
||||
CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10
|
||||
CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15
|
||||
# CONFIG_ESP_WIFI_FTM_ENABLE is not set
|
||||
CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y
|
||||
# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set
|
||||
# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set
|
||||
CONFIG_ESP_WIFI_GMAC_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y
|
||||
# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set
|
||||
CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7
|
||||
@@ -1033,6 +1098,8 @@ CONFIG_FATFS_PER_FILE_CACHE=y
|
||||
# CONFIG_FATFS_USE_FASTSEEK is not set
|
||||
CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0
|
||||
# CONFIG_FATFS_IMMEDIATE_FSYNC is not set
|
||||
# CONFIG_FATFS_USE_LABEL is not set
|
||||
CONFIG_FATFS_LINK_LOCK=y
|
||||
# end of FAT Filesystem support
|
||||
|
||||
#
|
||||
@@ -1056,12 +1123,16 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
|
||||
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
|
||||
# CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set
|
||||
CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc"
|
||||
# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set
|
||||
CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y
|
||||
CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF
|
||||
CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1
|
||||
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048
|
||||
CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10
|
||||
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
|
||||
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1
|
||||
# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set
|
||||
# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set
|
||||
# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set
|
||||
# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set
|
||||
# end of Kernel
|
||||
@@ -1091,6 +1162,7 @@ CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
|
||||
CONFIG_FREERTOS_DEBUG_OCDAWARE=y
|
||||
CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y
|
||||
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
|
||||
CONFIG_FREERTOS_NUMBER_OF_CORES=1
|
||||
# end of FreeRTOS
|
||||
|
||||
#
|
||||
@@ -1218,6 +1290,7 @@ CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000
|
||||
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760
|
||||
CONFIG_LWIP_TCP_WND_DEFAULT=5760
|
||||
CONFIG_LWIP_TCP_RECVMBOX_SIZE=6
|
||||
CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6
|
||||
CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
|
||||
CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6
|
||||
CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4
|
||||
@@ -1272,6 +1345,8 @@ CONFIG_LWIP_MAX_RAW_PCBS=16
|
||||
CONFIG_LWIP_SNTP_MAX_SERVERS=1
|
||||
# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set
|
||||
CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
|
||||
CONFIG_LWIP_SNTP_STARTUP_DELAY=y
|
||||
CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000
|
||||
# end of SNTP
|
||||
|
||||
#
|
||||
@@ -1341,6 +1416,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y
|
||||
# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set
|
||||
# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set
|
||||
# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set
|
||||
# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set
|
||||
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200
|
||||
# end of Certificate Bundle
|
||||
|
||||
@@ -1349,7 +1425,7 @@ CONFIG_MBEDTLS_CMAC_C=y
|
||||
CONFIG_MBEDTLS_HARDWARE_AES=y
|
||||
CONFIG_MBEDTLS_AES_USE_INTERRUPT=y
|
||||
CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0
|
||||
# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set
|
||||
CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y
|
||||
CONFIG_MBEDTLS_HARDWARE_MPI=y
|
||||
CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=y
|
||||
CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y
|
||||
@@ -1554,6 +1630,7 @@ CONFIG_SPI_FLASH_BROWNOUT_RESET=y
|
||||
#
|
||||
CONFIG_SPI_FLASH_SUSPEND_QVL_SUPPORTED=y
|
||||
# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set
|
||||
CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50
|
||||
# end of Optional and Experimental Features (READ DOCS FIRST)
|
||||
# end of Main Flash configuration
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file. DO NOT EDIT.
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.2.2 Project Configuration
|
||||
# Espressif IoT Development Framework (ESP-IDF) 5.3.0 Project Configuration
|
||||
#
|
||||
CONFIG_SOC_ADC_SUPPORTED=y
|
||||
CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y
|
||||
@@ -18,6 +18,7 @@ CONFIG_SOC_IEEE802154_SUPPORTED=y
|
||||
CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y
|
||||
CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y
|
||||
CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y
|
||||
CONFIG_SOC_PHY_SUPPORTED=y
|
||||
CONFIG_SOC_WIFI_SUPPORTED=y
|
||||
CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y
|
||||
CONFIG_SOC_ULP_SUPPORTED=y
|
||||
@@ -45,6 +46,7 @@ CONFIG_SOC_SECURE_BOOT_SUPPORTED=y
|
||||
CONFIG_SOC_SDIO_SLAVE_SUPPORTED=y
|
||||
CONFIG_SOC_BOD_SUPPORTED=y
|
||||
CONFIG_SOC_APM_SUPPORTED=y
|
||||
CONFIG_SOC_APM_CTRL_FILTER_SUPPORTED=y
|
||||
CONFIG_SOC_PMU_SUPPORTED=y
|
||||
CONFIG_SOC_PAU_SUPPORTED=y
|
||||
CONFIG_SOC_LP_TIMER_SUPPORTED=y
|
||||
@@ -56,6 +58,11 @@ CONFIG_SOC_CLK_TREE_SUPPORTED=y
|
||||
CONFIG_SOC_ASSIST_DEBUG_SUPPORTED=y
|
||||
CONFIG_SOC_WDT_SUPPORTED=y
|
||||
CONFIG_SOC_SPI_FLASH_SUPPORTED=y
|
||||
CONFIG_SOC_RNG_SUPPORTED=y
|
||||
CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y
|
||||
CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y
|
||||
CONFIG_SOC_MODEM_CLOCK_SUPPORTED=y
|
||||
CONFIG_SOC_PM_SUPPORTED=y
|
||||
CONFIG_SOC_XTAL_SUPPORT_40M=y
|
||||
CONFIG_SOC_AES_SUPPORT_DMA=y
|
||||
CONFIG_SOC_AES_GDMA=y
|
||||
@@ -92,6 +99,7 @@ CONFIG_SOC_CPU_CORES_NUM=1
|
||||
CONFIG_SOC_CPU_INTR_NUM=32
|
||||
CONFIG_SOC_CPU_HAS_FLEXIBLE_INTC=y
|
||||
CONFIG_SOC_INT_PLIC_SUPPORTED=y
|
||||
CONFIG_SOC_CPU_HAS_CSR_PC=y
|
||||
CONFIG_SOC_CPU_BREAKPOINTS_NUM=4
|
||||
CONFIG_SOC_CPU_WATCHPOINTS_NUM=4
|
||||
CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=0x80000000
|
||||
@@ -104,6 +112,7 @@ CONFIG_SOC_AHB_GDMA_VERSION=1
|
||||
CONFIG_SOC_GDMA_NUM_GROUPS_MAX=1
|
||||
CONFIG_SOC_GDMA_PAIRS_PER_GROUP_MAX=3
|
||||
CONFIG_SOC_GDMA_SUPPORT_ETM=y
|
||||
CONFIG_SOC_GDMA_SUPPORT_SLEEP_RETENTION=y
|
||||
CONFIG_SOC_ETM_GROUPS=1
|
||||
CONFIG_SOC_ETM_CHANNELS_PER_GROUP=50
|
||||
CONFIG_SOC_GPIO_PORT=1
|
||||
@@ -113,21 +122,27 @@ CONFIG_SOC_GPIO_FLEX_GLITCH_FILTER_NUM=8
|
||||
CONFIG_SOC_GPIO_SUPPORT_ETM=y
|
||||
CONFIG_SOC_GPIO_SUPPORT_RTC_INDEPENDENT=y
|
||||
CONFIG_SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP=y
|
||||
CONFIG_SOC_LP_IO_CLOCK_IS_INDEPENDENT=y
|
||||
CONFIG_SOC_GPIO_IN_RANGE_MAX=30
|
||||
CONFIG_SOC_GPIO_OUT_RANGE_MAX=30
|
||||
CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_VALID_GPIO_MASK=0
|
||||
CONFIG_SOC_GPIO_DEEP_SLEEP_WAKE_SUPPORTED_PIN_CNT=8
|
||||
CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x000000007FFFFF00
|
||||
CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y
|
||||
CONFIG_SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP=y
|
||||
CONFIG_SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX=y
|
||||
CONFIG_SOC_CLOCKOUT_HAS_SOURCE_GATE=y
|
||||
CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3
|
||||
CONFIG_SOC_RTCIO_PIN_COUNT=8
|
||||
CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y
|
||||
CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y
|
||||
CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y
|
||||
CONFIG_SOC_RTCIO_VALID_RTCIO_MASK=0xFF
|
||||
CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8
|
||||
CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8
|
||||
CONFIG_SOC_DEDIC_PERIPH_ALWAYS_ENABLE=y
|
||||
CONFIG_SOC_I2C_NUM=1
|
||||
CONFIG_SOC_I2C_NUM=2
|
||||
CONFIG_SOC_HP_I2C_NUM=1
|
||||
CONFIG_SOC_I2C_FIFO_LEN=32
|
||||
CONFIG_SOC_I2C_CMD_REG_NUM=8
|
||||
CONFIG_SOC_I2C_SUPPORT_SLAVE=y
|
||||
@@ -140,6 +155,7 @@ CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y
|
||||
CONFIG_SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE=y
|
||||
CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y
|
||||
CONFIG_SOC_I2C_SLAVE_SUPPORT_SLAVE_UNMATCH=y
|
||||
CONFIG_SOC_I2C_SUPPORT_SLEEP_RETENTION=y
|
||||
CONFIG_SOC_LP_I2C_NUM=1
|
||||
CONFIG_SOC_LP_I2C_FIFO_LEN=16
|
||||
CONFIG_SOC_I2S_NUM=1
|
||||
@@ -228,6 +244,10 @@ CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y
|
||||
CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y
|
||||
CONFIG_SOC_SPI_SUPPORT_CLK_PLL_F80M=y
|
||||
CONFIG_SOC_SPI_SUPPORT_CLK_RC_FAST=y
|
||||
CONFIG_SOC_SPI_SCT_SUPPORTED=y
|
||||
CONFIG_SOC_SPI_SCT_REG_NUM=14
|
||||
CONFIG_SOC_SPI_SCT_BUFFER_NUM_MAX=y
|
||||
CONFIG_SOC_SPI_SCT_CONF_BITLEN_MAX=0x3FFFA
|
||||
CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y
|
||||
CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16
|
||||
CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y
|
||||
@@ -258,6 +278,7 @@ CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y
|
||||
CONFIG_SOC_TIMER_GROUP_SUPPORT_RC_FAST=y
|
||||
CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=2
|
||||
CONFIG_SOC_TIMER_SUPPORT_ETM=y
|
||||
CONFIG_SOC_TIMER_SUPPORT_SLEEP_RETENTION=y
|
||||
CONFIG_SOC_MWDT_SUPPORT_XTAL=y
|
||||
CONFIG_SOC_TWAI_CONTROLLER_NUM=2
|
||||
CONFIG_SOC_TWAI_CLK_SUPPORT_XTAL=y
|
||||
@@ -276,7 +297,7 @@ CONFIG_SOC_SECURE_BOOT_V2_ECC=y
|
||||
CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=3
|
||||
CONFIG_SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS=y
|
||||
CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y
|
||||
CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32
|
||||
CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=64
|
||||
CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y
|
||||
CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y
|
||||
CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED=y
|
||||
@@ -291,6 +312,7 @@ CONFIG_SOC_UART_SUPPORT_RTC_CLK=y
|
||||
CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y
|
||||
CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y
|
||||
CONFIG_SOC_UART_HAS_LP_UART=y
|
||||
CONFIG_SOC_UART_SUPPORT_SLEEP_RETENTION=y
|
||||
CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y
|
||||
CONFIG_SOC_COEX_HW_PTI=y
|
||||
CONFIG_SOC_EXTERNAL_COEX_ADVANCE=y
|
||||
@@ -326,6 +348,8 @@ CONFIG_SOC_RCC_IS_INDEPENDENT=y
|
||||
CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC=y
|
||||
CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_XTAL=y
|
||||
CONFIG_SOC_TEMPERATURE_SENSOR_INTR_SUPPORT=y
|
||||
CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_ETM=y
|
||||
CONFIG_SOC_RNG_CLOCK_IS_INDEPENDENT=y
|
||||
CONFIG_SOC_WIFI_HW_TSF=y
|
||||
CONFIG_SOC_WIFI_FTM_SUPPORT=y
|
||||
CONFIG_SOC_WIFI_GCMP_SUPPORT=y
|
||||
@@ -345,12 +369,14 @@ CONFIG_SOC_BLE_MULTI_CONN_OPTIMIZATION=y
|
||||
CONFIG_SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND=y
|
||||
CONFIG_SOC_PHY_COMBO_MODULE=y
|
||||
CONFIG_SOC_CAPS_NO_RESET_BY_ANA_BOD=y
|
||||
CONFIG_SOC_LP_CORE_SINGLE_INTERRUPT_VECTOR=y
|
||||
CONFIG_SOC_LP_CORE_SUPPORT_ETM=y
|
||||
CONFIG_IDF_CMAKE=y
|
||||
CONFIG_IDF_TOOLCHAIN="gcc"
|
||||
CONFIG_IDF_TARGET_ARCH_RISCV=y
|
||||
CONFIG_IDF_TARGET_ARCH="riscv"
|
||||
CONFIG_IDF_TARGET="esp32c6"
|
||||
CONFIG_IDF_INIT_VERSION="5.2.2"
|
||||
CONFIG_IDF_INIT_VERSION="5.3.0"
|
||||
CONFIG_IDF_TARGET_ESP32C6=y
|
||||
CONFIG_IDF_FIRMWARE_CHIP_ID=0x000D
|
||||
|
||||
@@ -443,15 +469,21 @@ CONFIG_ESP_ROM_HAS_RVFPLIB=y
|
||||
CONFIG_ESP_ROM_HAS_HAL_WDT=y
|
||||
CONFIG_ESP_ROM_HAS_HAL_SYSTIMER=y
|
||||
CONFIG_ESP_ROM_HAS_HEAP_TLSF=y
|
||||
CONFIG_ESP_ROM_TLSF_CHECK_PATCH=y
|
||||
CONFIG_ESP_ROM_MULTI_HEAP_WALK_PATCH=y
|
||||
CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y
|
||||
CONFIG_ESP_ROM_HAS_SPI_FLASH=y
|
||||
CONFIG_ESP_ROM_HAS_REGI2C_BUG=y
|
||||
CONFIG_ESP_ROM_HAS_NEWLIB=y
|
||||
CONFIG_ESP_ROM_HAS_NEWLIB_NORMAL_FORMAT=y
|
||||
CONFIG_ESP_ROM_REV0_HAS_NO_ECDSA_INTERFACE=y
|
||||
CONFIG_ESP_ROM_WDT_INIT_PATCH=y
|
||||
CONFIG_ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE=y
|
||||
CONFIG_ESP_ROM_RAM_APP_NEEDS_MMU_INIT=y
|
||||
CONFIG_ESP_ROM_HAS_SW_FLOAT=y
|
||||
CONFIG_ESP_ROM_USB_OTG_NUM=-1
|
||||
CONFIG_ESP_ROM_HAS_VERSION=y
|
||||
CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y
|
||||
|
||||
#
|
||||
# Boot ROM Behavior
|
||||
@@ -537,6 +569,8 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
|
||||
# CONFIG_COMPILER_DUMP_RTL_FILES is not set
|
||||
CONFIG_COMPILER_RT_LIB_GCCLIB=y
|
||||
CONFIG_COMPILER_RT_LIB_NAME="gcc"
|
||||
# CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING is not set
|
||||
CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y
|
||||
# end of Compiler options
|
||||
|
||||
#
|
||||
@@ -562,31 +596,16 @@ CONFIG_APPTRACE_LOCK_ENABLE=y
|
||||
CONFIG_BT_ALARM_MAX_NUM=50
|
||||
# end of Bluetooth
|
||||
|
||||
#
|
||||
# Console Library
|
||||
#
|
||||
# CONFIG_CONSOLE_SORTED_HELP is not set
|
||||
# end of Console Library
|
||||
|
||||
#
|
||||
# Driver Configurations
|
||||
#
|
||||
|
||||
#
|
||||
# Legacy ADC Configuration
|
||||
#
|
||||
# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
|
||||
|
||||
#
|
||||
# Legacy ADC Calibration Configuration
|
||||
#
|
||||
# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy ADC Calibration Configuration
|
||||
# end of Legacy ADC Configuration
|
||||
|
||||
#
|
||||
# SPI Configuration
|
||||
#
|
||||
# CONFIG_SPI_MASTER_IN_IRAM is not set
|
||||
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
|
||||
# CONFIG_SPI_SLAVE_IN_IRAM is not set
|
||||
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
||||
# end of SPI Configuration
|
||||
|
||||
#
|
||||
# TWAI Configuration
|
||||
#
|
||||
@@ -594,102 +613,58 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
||||
# end of TWAI Configuration
|
||||
|
||||
#
|
||||
# Temperature sensor Configuration
|
||||
# Legacy ADC Driver Configuration
|
||||
#
|
||||
# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set
|
||||
|
||||
#
|
||||
# Legacy ADC Calibration Configuration
|
||||
#
|
||||
# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy ADC Calibration Configuration
|
||||
# end of Legacy ADC Driver Configuration
|
||||
|
||||
#
|
||||
# Legacy MCPWM Driver Configurations
|
||||
#
|
||||
# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy MCPWM Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy Timer Group Driver Configurations
|
||||
#
|
||||
# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy Timer Group Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy RMT Driver Configurations
|
||||
#
|
||||
# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy RMT Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy I2S Driver Configurations
|
||||
#
|
||||
# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy I2S Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy PCNT Driver Configurations
|
||||
#
|
||||
# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy PCNT Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy SDM Driver Configurations
|
||||
#
|
||||
# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# end of Legacy SDM Driver Configurations
|
||||
|
||||
#
|
||||
# Legacy Temperature Sensor Driver Configurations
|
||||
#
|
||||
# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set
|
||||
# CONFIG_TEMP_SENSOR_ISR_IRAM_SAFE is not set
|
||||
# end of Temperature sensor Configuration
|
||||
|
||||
#
|
||||
# UART Configuration
|
||||
#
|
||||
# CONFIG_UART_ISR_IN_IRAM is not set
|
||||
# end of UART Configuration
|
||||
|
||||
#
|
||||
# GPIO Configuration
|
||||
#
|
||||
# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of GPIO Configuration
|
||||
|
||||
#
|
||||
# Sigma Delta Modulator Configuration
|
||||
#
|
||||
# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_SDM_ENABLE_DEBUG_LOG is not set
|
||||
# end of Sigma Delta Modulator Configuration
|
||||
|
||||
#
|
||||
# GPTimer Configuration
|
||||
#
|
||||
CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y
|
||||
# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set
|
||||
# end of GPTimer Configuration
|
||||
|
||||
#
|
||||
# PCNT Configuration
|
||||
#
|
||||
# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_PCNT_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set
|
||||
# end of PCNT Configuration
|
||||
|
||||
#
|
||||
# RMT Configuration
|
||||
#
|
||||
# CONFIG_RMT_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set
|
||||
# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_RMT_ENABLE_DEBUG_LOG is not set
|
||||
# end of RMT Configuration
|
||||
|
||||
#
|
||||
# MCPWM Configuration
|
||||
#
|
||||
# CONFIG_MCPWM_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set
|
||||
# end of MCPWM Configuration
|
||||
|
||||
#
|
||||
# I2S Configuration
|
||||
#
|
||||
# CONFIG_I2S_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set
|
||||
# CONFIG_I2S_ENABLE_DEBUG_LOG is not set
|
||||
# end of I2S Configuration
|
||||
|
||||
#
|
||||
# USB Serial/JTAG Configuration
|
||||
#
|
||||
# end of USB Serial/JTAG Configuration
|
||||
|
||||
#
|
||||
# Parallel IO Configuration
|
||||
#
|
||||
# CONFIG_PARLIO_ENABLE_DEBUG_LOG is not set
|
||||
# CONFIG_PARLIO_ISR_IRAM_SAFE is not set
|
||||
# end of Parallel IO Configuration
|
||||
|
||||
#
|
||||
# LEDC Configuration
|
||||
#
|
||||
# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of LEDC Configuration
|
||||
|
||||
#
|
||||
# I2C Configuration
|
||||
#
|
||||
# CONFIG_I2C_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2C_ENABLE_DEBUG_LOG is not set
|
||||
# end of I2C Configuration
|
||||
# end of Legacy Temperature Sensor Driver Configurations
|
||||
# end of Driver Configurations
|
||||
|
||||
#
|
||||
@@ -706,7 +681,9 @@ CONFIG_EFUSE_MAX_BLK_LEN=256
|
||||
CONFIG_ESP_TLS_USING_MBEDTLS=y
|
||||
CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y
|
||||
# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set
|
||||
# CONFIG_ESP_TLS_SERVER is not set
|
||||
# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set
|
||||
# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set
|
||||
# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set
|
||||
# CONFIG_ESP_TLS_PSK_VERIFICATION is not set
|
||||
# CONFIG_ESP_TLS_INSECURE is not set
|
||||
# end of ESP-TLS
|
||||
@@ -716,13 +693,16 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y
|
||||
#
|
||||
# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_ADC_ENABLE_DEBUG_LOG is not set
|
||||
# end of ADC and ADC Calibration
|
||||
|
||||
#
|
||||
# Wireless Coexistence
|
||||
#
|
||||
CONFIG_ESP_COEX_ENABLED=y
|
||||
CONFIG_ESP_COEX_SW_COEXIST_ENABLE=y
|
||||
# CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set
|
||||
# CONFIG_ESP_COEX_POWER_MANAGEMENT is not set
|
||||
# end of Wireless Coexistence
|
||||
|
||||
#
|
||||
@@ -731,6 +711,107 @@ CONFIG_ESP_COEX_SW_COEXIST_ENABLE=y
|
||||
CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
|
||||
# end of Common ESP-related
|
||||
|
||||
#
|
||||
# ESP-Driver:GPIO Configurations
|
||||
#
|
||||
# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of ESP-Driver:GPIO Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:GPTimer Configurations
|
||||
#
|
||||
CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y
|
||||
# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:GPTimer Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:I2C Configurations
|
||||
#
|
||||
# CONFIG_I2C_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2C_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:I2C Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:I2S Configurations
|
||||
#
|
||||
# CONFIG_I2S_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_I2S_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:I2S Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:LEDC Configurations
|
||||
#
|
||||
# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set
|
||||
# end of ESP-Driver:LEDC Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:MCPWM Configurations
|
||||
#
|
||||
# CONFIG_MCPWM_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:MCPWM Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:Parallel IO Configurations
|
||||
#
|
||||
# CONFIG_PARLIO_ENABLE_DEBUG_LOG is not set
|
||||
# CONFIG_PARLIO_ISR_IRAM_SAFE is not set
|
||||
# end of ESP-Driver:Parallel IO Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:PCNT Configurations
|
||||
#
|
||||
# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_PCNT_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:PCNT Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:RMT Configurations
|
||||
#
|
||||
# CONFIG_RMT_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set
|
||||
# CONFIG_RMT_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:RMT Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:Sigma Delta Modulator Configurations
|
||||
#
|
||||
# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set
|
||||
# CONFIG_SDM_ENABLE_DEBUG_LOG is not set
|
||||
# end of ESP-Driver:Sigma Delta Modulator Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:SPI Configurations
|
||||
#
|
||||
# CONFIG_SPI_MASTER_IN_IRAM is not set
|
||||
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
|
||||
# CONFIG_SPI_SLAVE_IN_IRAM is not set
|
||||
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
||||
# end of ESP-Driver:SPI Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:Temperature Sensor Configurations
|
||||
#
|
||||
# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set
|
||||
# CONFIG_TEMP_SENSOR_ISR_IRAM_SAFE is not set
|
||||
# end of ESP-Driver:Temperature Sensor Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:UART Configurations
|
||||
#
|
||||
# CONFIG_UART_ISR_IN_IRAM is not set
|
||||
# end of ESP-Driver:UART Configurations
|
||||
|
||||
#
|
||||
# ESP-Driver:USB Serial/JTAG Configuration
|
||||
#
|
||||
CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y
|
||||
# end of ESP-Driver:USB Serial/JTAG Configuration
|
||||
|
||||
#
|
||||
# Ethernet
|
||||
#
|
||||
@@ -766,6 +847,7 @@ CONFIG_ESP_GDBSTUB_MAX_TASKS=32
|
||||
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set
|
||||
# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set
|
||||
# end of ESP HTTP client
|
||||
|
||||
#
|
||||
@@ -821,6 +903,7 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y
|
||||
CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y
|
||||
CONFIG_ESP_MAC_ADDR_UNIVERSE_IEEE802154=y
|
||||
CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y
|
||||
CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4
|
||||
# CONFIG_ESP32C6_UNIVERSAL_MAC_ADDRESSES_TWO is not set
|
||||
CONFIG_ESP32C6_UNIVERSAL_MAC_ADDRESSES_FOUR=y
|
||||
CONFIG_ESP32C6_UNIVERSAL_MAC_ADDRESSES=4
|
||||
@@ -863,12 +946,12 @@ CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y
|
||||
# end of ETM Configuration
|
||||
|
||||
#
|
||||
# GDMA Configuration
|
||||
# GDMA Configurations
|
||||
#
|
||||
# CONFIG_GDMA_CTRL_FUNC_IN_IRAM is not set
|
||||
CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y
|
||||
# CONFIG_GDMA_ISR_IRAM_SAFE is not set
|
||||
# CONFIG_GDMA_ENABLE_DEBUG_LOG is not set
|
||||
# end of GDMA Configuration
|
||||
# end of GDMA Configurations
|
||||
|
||||
#
|
||||
# Main XTAL Config
|
||||
@@ -886,6 +969,8 @@ CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL_LOW=y
|
||||
# CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL_HIGH is not set
|
||||
CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL=1
|
||||
# end of Crypto DPA Protection
|
||||
|
||||
CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y
|
||||
# end of Hardware Settings
|
||||
|
||||
#
|
||||
@@ -899,7 +984,6 @@ CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL=1
|
||||
#
|
||||
# LCD Peripheral Configuration
|
||||
#
|
||||
CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32
|
||||
# CONFIG_LCD_ENABLE_DEBUG_LOG is not set
|
||||
# end of LCD Peripheral Configuration
|
||||
# end of LCD and Touch Panel
|
||||
@@ -924,6 +1008,7 @@ CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y
|
||||
#
|
||||
# PHY
|
||||
#
|
||||
CONFIG_ESP_PHY_ENABLED=y
|
||||
CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y
|
||||
# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set
|
||||
CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20
|
||||
@@ -940,6 +1025,7 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0
|
||||
# Power Management
|
||||
#
|
||||
# CONFIG_PM_ENABLE is not set
|
||||
CONFIG_PM_SLP_DEFAULT_PARAMS_OPT=y
|
||||
CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
|
||||
# CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP is not set
|
||||
# end of Power Management
|
||||
@@ -993,6 +1079,7 @@ CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
|
||||
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y
|
||||
CONFIG_ESP_CONSOLE_UART=y
|
||||
CONFIG_ESP_CONSOLE_UART_NUM=0
|
||||
CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0
|
||||
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
|
||||
CONFIG_ESP_INT_WDT=y
|
||||
CONFIG_ESP_INT_WDT_TIMEOUT_MS=300
|
||||
@@ -1022,6 +1109,7 @@ CONFIG_ESP_BROWNOUT_DET_LVL=7
|
||||
CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y
|
||||
CONFIG_ESP_SYSTEM_HW_STACK_GUARD=y
|
||||
CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y
|
||||
CONFIG_ESP_SYSTEM_HW_PC_RECORD=y
|
||||
# end of ESP System Settings
|
||||
|
||||
#
|
||||
@@ -1031,7 +1119,7 @@ CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
|
||||
# end of IPC (Inter-Processor Call)
|
||||
|
||||
#
|
||||
# High resolution timer (esp_timer)
|
||||
# ESP Timer (High Resolution Timer)
|
||||
#
|
||||
# CONFIG_ESP_TIMER_PROFILING is not set
|
||||
CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y
|
||||
@@ -1041,11 +1129,10 @@ CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1
|
||||
# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set
|
||||
CONFIG_ESP_TIMER_TASK_AFFINITY=0x0
|
||||
CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y
|
||||
CONFIG_ESP_TIMER_ISR_AFFINITY=0x1
|
||||
CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y
|
||||
# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set
|
||||
CONFIG_ESP_TIMER_IMPL_SYSTIMER=y
|
||||
# end of High resolution timer (esp_timer)
|
||||
# end of ESP Timer (High Resolution Timer)
|
||||
|
||||
#
|
||||
# Wi-Fi
|
||||
@@ -1076,15 +1163,17 @@ CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y
|
||||
CONFIG_ESP_WIFI_ENABLE_SAE_PK=y
|
||||
CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y
|
||||
# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set
|
||||
CONFIG_ESP_WIFI_SLP_IRAM_OPT=y
|
||||
CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50
|
||||
CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10
|
||||
CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15
|
||||
# CONFIG_ESP_WIFI_FTM_ENABLE is not set
|
||||
CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y
|
||||
# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set
|
||||
# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set
|
||||
CONFIG_ESP_WIFI_GMAC_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y
|
||||
# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set
|
||||
CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7
|
||||
CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS=y
|
||||
CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y
|
||||
CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y
|
||||
# CONFIG_ESP_WIFI_WAPI_PSK is not set
|
||||
@@ -1094,8 +1183,9 @@ CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y
|
||||
# CONFIG_ESP_WIFI_DPP_SUPPORT is not set
|
||||
# CONFIG_ESP_WIFI_11R_SUPPORT is not set
|
||||
# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set
|
||||
CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS=y
|
||||
CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS=y
|
||||
# CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS is not set
|
||||
# CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS is not set
|
||||
CONFIG_ESP_WIFI_TX_HETB_QUEUE_NUM=3
|
||||
|
||||
#
|
||||
# WPS Configuration Options
|
||||
@@ -1156,6 +1246,8 @@ CONFIG_FATFS_PER_FILE_CACHE=y
|
||||
# CONFIG_FATFS_USE_FASTSEEK is not set
|
||||
CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0
|
||||
# CONFIG_FATFS_IMMEDIATE_FSYNC is not set
|
||||
# CONFIG_FATFS_USE_LABEL is not set
|
||||
CONFIG_FATFS_LINK_LOCK=y
|
||||
# end of FAT Filesystem support
|
||||
|
||||
#
|
||||
@@ -1179,12 +1271,16 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
|
||||
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
|
||||
# CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set
|
||||
CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc"
|
||||
# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set
|
||||
CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y
|
||||
CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF
|
||||
CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1
|
||||
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048
|
||||
CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10
|
||||
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
|
||||
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1
|
||||
# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set
|
||||
# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set
|
||||
# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set
|
||||
# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set
|
||||
# end of Kernel
|
||||
@@ -1214,6 +1310,7 @@ CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
|
||||
CONFIG_FREERTOS_DEBUG_OCDAWARE=y
|
||||
CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y
|
||||
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
|
||||
CONFIG_FREERTOS_NUMBER_OF_CORES=1
|
||||
# end of FreeRTOS
|
||||
|
||||
#
|
||||
@@ -1360,6 +1457,7 @@ CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000
|
||||
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760
|
||||
CONFIG_LWIP_TCP_WND_DEFAULT=5760
|
||||
CONFIG_LWIP_TCP_RECVMBOX_SIZE=6
|
||||
CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6
|
||||
CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
|
||||
CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6
|
||||
CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4
|
||||
@@ -1414,6 +1512,8 @@ CONFIG_LWIP_MAX_RAW_PCBS=16
|
||||
CONFIG_LWIP_SNTP_MAX_SERVERS=1
|
||||
# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set
|
||||
CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
|
||||
CONFIG_LWIP_SNTP_STARTUP_DELAY=y
|
||||
CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000
|
||||
# end of SNTP
|
||||
|
||||
#
|
||||
@@ -1483,6 +1583,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y
|
||||
# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set
|
||||
# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set
|
||||
# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set
|
||||
# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set
|
||||
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200
|
||||
# end of Certificate Bundle
|
||||
|
||||
@@ -1491,7 +1592,7 @@ CONFIG_MBEDTLS_CMAC_C=y
|
||||
CONFIG_MBEDTLS_HARDWARE_AES=y
|
||||
CONFIG_MBEDTLS_AES_USE_INTERRUPT=y
|
||||
CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0
|
||||
# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set
|
||||
CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y
|
||||
CONFIG_MBEDTLS_HARDWARE_MPI=y
|
||||
CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=y
|
||||
CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y
|
||||
@@ -1696,6 +1797,7 @@ CONFIG_SPI_FLASH_BROWNOUT_RESET=y
|
||||
#
|
||||
# Features here require specific hardware (READ DOCS FIRST!)
|
||||
#
|
||||
CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50
|
||||
# end of Optional and Experimental Features (READ DOCS FIRST)
|
||||
# end of Main Flash configuration
|
||||
|
||||
@@ -1786,6 +1888,11 @@ CONFIG_WS_BUFFER_SIZE=1024
|
||||
# Ultra Low Power (ULP) Co-processor
|
||||
#
|
||||
# CONFIG_ULP_COPROC_ENABLED is not set
|
||||
|
||||
#
|
||||
# ULP Debugging Options
|
||||
#
|
||||
# end of ULP Debugging Options
|
||||
# end of Ultra Low Power (ULP) Co-processor
|
||||
|
||||
#
|
||||
@@ -1880,12 +1987,12 @@ CONFIG_STACK_CHECK_NONE=y
|
||||
# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set
|
||||
CONFIG_ESP32_APPTRACE_DEST_NONE=y
|
||||
CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
|
||||
# CONFIG_MCPWM_ISR_IN_IRAM is not set
|
||||
CONFIG_SW_COEXIST_ENABLE=y
|
||||
CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y
|
||||
CONFIG_ESP_WIFI_SW_COEXIST_ENABLE=y
|
||||
# CONFIG_EXTERNAL_COEX_ENABLE is not set
|
||||
# CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set
|
||||
# CONFIG_MCPWM_ISR_IN_IRAM is not set
|
||||
# CONFIG_EVENT_LOOP_PROFILING is not set
|
||||
CONFIG_POST_EVENTS_FROM_ISR=y
|
||||
CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
|
||||
|
||||
24
rx_esp32/servo/__init__.py
Normal file
24
rx_esp32/servo/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
##
|
||||
## This file is part of the libsigrokdecode project.
|
||||
##
|
||||
## Copyright (C) 2014 Torsten Duwe <duwe@suse.de>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
'''
|
||||
Servo decoder
|
||||
'''
|
||||
|
||||
from .pd import Decoder
|
||||
141
rx_esp32/servo/pd.py
Normal file
141
rx_esp32/servo/pd.py
Normal file
@@ -0,0 +1,141 @@
|
||||
|
||||
##
|
||||
## This file is base of the timeing decoder from the libsigrokdecode project made by
|
||||
## Torsten Duwe <duwe@suse.de> and Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
|
||||
## and converted to a Servo decoder by FReenen <git@finnvanreenen.nl>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
import sigrokdecode as srd
|
||||
|
||||
class SamplerateError(Exception):
|
||||
pass
|
||||
|
||||
class Decoder(srd.Decoder):
|
||||
api_version = 3
|
||||
id = 'servo'
|
||||
name = 'Servo'
|
||||
longname = 'Servo PWM signal (1 to 2 ms pulses every 20 ms)'
|
||||
desc = '1 to 2 ms pulses every 20 ms'
|
||||
license = 'gplv2+'
|
||||
inputs = ['logic']
|
||||
outputs = []
|
||||
tags = ['Encoding']
|
||||
channels = (
|
||||
{'id': 'data', 'name': 'Data', 'desc': 'Data line'},
|
||||
)
|
||||
options = (
|
||||
{'id': 'polarity', 'desc': 'Polarity', 'default': 'active-high',
|
||||
'values': ('active-low', 'active-high')},
|
||||
)
|
||||
annotations = (
|
||||
('duty-cycle', 'Duty cycle'),
|
||||
('period', 'Period'),
|
||||
)
|
||||
annotation_rows = (
|
||||
('duty-cycle', 'Duty cycle', (0,)),
|
||||
('period', 'Period', (1,)),
|
||||
)
|
||||
# binary = (
|
||||
# ('raw', 'RAW file'),
|
||||
# )
|
||||
|
||||
def __init__(self):
|
||||
self.reset()
|
||||
|
||||
def reset(self):
|
||||
self.samplerate = None
|
||||
self.ss_block = self.es_block = None
|
||||
|
||||
def metadata(self, key, value):
|
||||
if key == srd.SRD_CONF_SAMPLERATE:
|
||||
self.samplerate = value
|
||||
|
||||
def start(self):
|
||||
self.out_ann = self.register(srd.OUTPUT_ANN)
|
||||
self.out_binary = self.register(srd.OUTPUT_BINARY)
|
||||
self.out_average = \
|
||||
self.register(srd.OUTPUT_META,
|
||||
meta=(float, 'Average', 'PWM base (cycle) frequency'))
|
||||
|
||||
def putx(self, data):
|
||||
self.put(self.ss_block, self.es_block, self.out_ann, data)
|
||||
|
||||
def putp(self, period_t):
|
||||
# Adjust granularity.
|
||||
# if period_t == 0 or period_t >= 1:
|
||||
# period_s = '%.1f s' % (period_t)
|
||||
# elif period_t <= 1e-12:
|
||||
# period_s = '%.1f fs' % (period_t * 1e15)
|
||||
# elif period_t <= 1e-9:
|
||||
# period_s = '%.1f ps' % (period_t * 1e12)
|
||||
# elif period_t <= 1e-6:
|
||||
# period_s = '%.1f ns' % (period_t * 1e9)
|
||||
# elif period_t <= 1e-3:
|
||||
# period_s = '%.1f μs' % (period_t * 1e6)
|
||||
# else:
|
||||
# period_s = '%.1f ms' % (period_t * 1e3)
|
||||
|
||||
period_s = '%.3f' % (period_t * 1e3)
|
||||
|
||||
self.put(self.ss_block, self.es_block, self.out_ann, [1, [period_s]])
|
||||
|
||||
def putb(self, data):
|
||||
self.put(self.ss_block, self.es_block, self.out_binary, data)
|
||||
|
||||
def decode(self):
|
||||
if not self.samplerate:
|
||||
raise SamplerateError('Cannot decode without samplerate.')
|
||||
|
||||
num_cycles = 0
|
||||
average = 0
|
||||
|
||||
# Wait for an "active" edge (depends on config). This starts
|
||||
# the first full period of the inspected signal waveform.
|
||||
self.wait({0: 'f' if self.options['polarity'] == 'active-low' else 'r'})
|
||||
self.first_samplenum = self.samplenum
|
||||
|
||||
# Keep getting samples for the period's middle and terminal edges.
|
||||
# At the same time that last sample starts the next period.
|
||||
while True:
|
||||
|
||||
# Get the next two edges. Setup some variables that get
|
||||
# referenced in the calculation and in put() routines.
|
||||
start_samplenum = self.samplenum
|
||||
self.wait({0: 'f'})
|
||||
end_samplenum = self.samplenum
|
||||
self.wait({0: 'r'})
|
||||
self.ss_block = start_samplenum
|
||||
self.es_block = self.samplenum
|
||||
|
||||
pulse = float((end_samplenum - start_samplenum) / self.samplerate)
|
||||
ratio = (pulse - 0.0015) / 0.0005
|
||||
|
||||
# Report the duty cycle in percent.
|
||||
# percent = float(ratio * 100)
|
||||
# self.putx([0, ['%f%%' % percent]])
|
||||
|
||||
# Report the duty cycle in the binary output.
|
||||
# self.putb([0, bytes([int(ratio * 128)])])
|
||||
|
||||
# Report the period in units of time.
|
||||
# print("servo pulse: " + str(pulse))
|
||||
self.putp(pulse)
|
||||
|
||||
# Update and report the new duty cycle average.
|
||||
# num_cycles += 1
|
||||
# average += percent
|
||||
# self.put(self.first_samplenum, self.es_block, self.out_average,
|
||||
# float(average / num_cycles))
|
||||
35
rx_esp32/set-target.sh
Executable file
35
rx_esp32/set-target.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
|
||||
case $1 in
|
||||
"rx")
|
||||
IC="esp32c3"
|
||||
opts="-D IC=$IC -D target=rx"
|
||||
;;
|
||||
"tx")
|
||||
IC="esp32c6"
|
||||
opts="-D IC=$IC -D target=tx"
|
||||
;;
|
||||
*)
|
||||
echo "Use 'rx' or 'tx'."
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -f sdkconfig.$IC ]
|
||||
then
|
||||
rm sdkconfig dependencies.lock
|
||||
|
||||
idf.py fullclean
|
||||
|
||||
cp sdkconfig.$IC sdkconfig
|
||||
jinja2 $opts dependencies.lock.j2 >dependencies.lock
|
||||
jinja2 $opts src/config.h.j2 >src/config.h
|
||||
|
||||
idf.py --version &>/dev/null || {
|
||||
. $IDF_TOOLS_PATH/esp-idf/export.sh
|
||||
}
|
||||
|
||||
idf.py set-target $IC
|
||||
# idf.py build $2
|
||||
else
|
||||
echo "SDK config file for $IC not found."
|
||||
fi
|
||||
@@ -12,6 +12,7 @@ idf_component_register(
|
||||
./servos.c
|
||||
./logger.c
|
||||
./ws.c
|
||||
./adc.c
|
||||
INCLUDE_DIRS "./"
|
||||
PRIV_REQUIRES
|
||||
# project components
|
||||
@@ -19,6 +20,6 @@ idf_component_register(
|
||||
# idf extra components
|
||||
led_strip
|
||||
# idf base components
|
||||
esp_websocket_client
|
||||
esp_websocket_client esp_adc
|
||||
spi_flash driver nvs_flash esp_wifi
|
||||
)
|
||||
|
||||
80
rx_esp32/src/adc.c
Normal file
80
rx_esp32/src/adc.c
Normal file
@@ -0,0 +1,80 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <esp_adc/adc_continuous.h>
|
||||
|
||||
#include "adc.h"
|
||||
#include "hal/adc_types.h"
|
||||
|
||||
adc_digi_output_data_t ADC_Buffer[6][10];
|
||||
uint8_t ADC_conf_available = 0;
|
||||
adc_continuous_handle_t adc_handle;
|
||||
|
||||
static bool IRAM_ATTR s_conv_done_cb(adc_continuous_handle_t handle, const adc_continuous_evt_data_t *edata, void *user_data)
|
||||
{
|
||||
// BaseType_t mustYield = pdFALSE;
|
||||
// //Notify that ADC continuous driver has done enough number of conversions
|
||||
// vTaskNotifyGiveFromISR(s_task_handle, &mustYield);
|
||||
// return (mustYield == pdTRUE);
|
||||
ADC_conf_available++;
|
||||
return true;
|
||||
}
|
||||
|
||||
void adc_init()
|
||||
{
|
||||
adc_continuous_handle_cfg_t adc_config = {
|
||||
.max_store_buf_size = sizeof(ADC_Buffer),
|
||||
.conv_frame_size = sizeof(adc_digi_output_data_t) * 6,
|
||||
};
|
||||
adc_continuous_new_handle(&adc_config, &adc_handle);
|
||||
|
||||
adc_continuous_config_t dig_cfg = {
|
||||
.sample_freq_hz = 611, //100 * 6,
|
||||
.conv_mode = ADC_CONV_SINGLE_UNIT_1,
|
||||
.format = ADC_DIGI_OUTPUT_FORMAT_TYPE2,
|
||||
};
|
||||
|
||||
adc_digi_pattern_config_t adc_pattern[SOC_ADC_PATT_LEN_MAX] = {0};
|
||||
dig_cfg.pattern_num = 6;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
adc_pattern[i].atten = ADC_ATTEN_DB_12;
|
||||
adc_pattern[i].unit = ADC_UNIT_1;
|
||||
adc_pattern[i].bit_width = ADC_BITWIDTH_12;
|
||||
}
|
||||
adc_pattern[0].channel = ADC_CHANNEL_0 & 0x7;
|
||||
adc_pattern[1].channel = ADC_CHANNEL_1 & 0x7;
|
||||
adc_pattern[2].channel = ADC_CHANNEL_2 & 0x7;
|
||||
adc_pattern[3].channel = ADC_CHANNEL_3 & 0x7;
|
||||
adc_pattern[4].channel = ADC_CHANNEL_4 & 0x7;
|
||||
adc_pattern[5].channel = ADC_CHANNEL_5 & 0x7;
|
||||
dig_cfg.adc_pattern = adc_pattern;
|
||||
adc_continuous_config(adc_handle, &dig_cfg);
|
||||
|
||||
adc_continuous_evt_cbs_t cbs = {
|
||||
.on_conv_done = s_conv_done_cb,
|
||||
};
|
||||
adc_continuous_register_event_callbacks(adc_handle, &cbs, NULL);
|
||||
adc_continuous_start(adc_handle);
|
||||
}
|
||||
|
||||
bool adc_read(ADC_Data_t* out_data)
|
||||
{
|
||||
adc_digi_output_data_t data[6];
|
||||
uint32_t ret_num = 0;
|
||||
esp_err_t ret = adc_continuous_read(
|
||||
adc_handle,
|
||||
(uint8_t*)&data,
|
||||
sizeof(adc_digi_output_data_t) * 6,
|
||||
&ret_num,
|
||||
0
|
||||
);
|
||||
if (ret == ESP_OK)
|
||||
{
|
||||
for (uint8_t i=0; i<3; i++) {
|
||||
for (uint8_t ii=0; ii<2; ii++) {
|
||||
out_data->value[i][ii] = data[i*2 + ii].type2.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (ret == ESP_OK);
|
||||
}
|
||||
14
rx_esp32/src/adc.h
Normal file
14
rx_esp32/src/adc.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef ADC_H
|
||||
#define ADC_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct {
|
||||
uint16_t value[3][2];
|
||||
} ADC_Data_t;
|
||||
|
||||
void adc_init();
|
||||
bool adc_read(ADC_Data_t* data);
|
||||
|
||||
#endif // ADC_H
|
||||
@@ -59,8 +59,8 @@ int cmd_contrl(char* line, void* cli)
|
||||
{
|
||||
readInt(arg, &ch_d[1]);
|
||||
|
||||
servo_set(0, (int16_t)ch_d[0]);
|
||||
servo_set(1, (int16_t)ch_d[1]);
|
||||
servo_set(0, (uint8_t)ch_d[0]);
|
||||
servo_set(1, (uint8_t)ch_d[1]);
|
||||
snprintf(&msg[0], 40, "channel data: 0:%lu, 1:%lu\n", ch_d[0], ch_d[1]);
|
||||
CLI_stringOut((CLI_t*)cli, &msg[0]);
|
||||
}
|
||||
@@ -68,6 +68,38 @@ int cmd_contrl(char* line, void* cli)
|
||||
return out;
|
||||
}
|
||||
|
||||
// servotrim:0 410;614;819
|
||||
int cmd_servotrim(char* line, void* cli)
|
||||
{
|
||||
uint8_t ch;
|
||||
int out = 0;
|
||||
char msg[40];
|
||||
|
||||
char* arg = getNextArg(line, ':');
|
||||
if (arg == NULL)
|
||||
{
|
||||
snprintf(&msg[0], 40, "no arguments given, expect at least one\n");
|
||||
CLI_stringOut((CLI_t*)cli, &msg[0]);
|
||||
out = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
readInt(arg, &ch);
|
||||
arg = getNextArg(arg, ' ');
|
||||
if (arg != NULL)
|
||||
{
|
||||
readInt(arg, &Servos[ch].pulse_min);
|
||||
arg = getNextArg(arg, ':');
|
||||
readInt(arg, &Servos[ch].pulse_mid);
|
||||
arg = getNextArg(arg, ':');
|
||||
readInt(arg, &Servos[ch].pulse_max);
|
||||
}
|
||||
snprintf(&msg[0], 40, "servo ch %d: %d:%d:%d\n", Servos[ch].pulse_min, Servos[ch].pulse_mid, Servos[ch].pulse_max);
|
||||
CLI_stringOut((CLI_t*)cli, &msg[0]);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
extern volatile bool running;
|
||||
int cmd_shutdown(char* line, void* cli)
|
||||
{
|
||||
@@ -158,11 +190,15 @@ int cmd_clearlog(char* line, void* cli)
|
||||
}
|
||||
|
||||
const CMD_t Commands[] = {
|
||||
{ "history", &cmd_history },
|
||||
#if TARGET == TARGET_RX
|
||||
{ "d", &cmd_contrl },
|
||||
{ "shutdown", &cmd_shutdown },
|
||||
{ "status", &cmd_status },
|
||||
{ "servotrim", &cmd_servotrim},
|
||||
#elif TARGET == TARGET_TX
|
||||
{ "led", &setLed },
|
||||
#endif
|
||||
{ "history", &cmd_history },
|
||||
{ "shutdown", &cmd_shutdown },
|
||||
{ "log", &cmd_showlog },
|
||||
{ "logclear", &cmd_clearlog }
|
||||
};
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// #define WIFI_SSID "UPC46273"
|
||||
// #define WIFI_AUTH WIFI_AUTH_WPA_PSK
|
||||
// #define WIFI_PASS "SPHZHKRY"
|
||||
// #define WIFI_SSID "Wifi Ding"
|
||||
// #define WIFI_AUTH WIFI_AUTH_WPA_WPA2_PSK
|
||||
// #define WIFI_PASS "Weet ik niet."
|
||||
#define WIFI_SSID "MBCBootjes"
|
||||
#define WIFI_AUTH WIFI_AUTH_WPA_WPA2_PSK
|
||||
#define WIFI_PASS "hetgrootedok"
|
||||
|
||||
// #define UDP_PORT 1234
|
||||
|
||||
#define BOAT_NAME "Test boat"
|
||||
static uint8_t BoatId = 1;
|
||||
|
||||
#define HISTORY // enable cli history
|
||||
|
||||
#define SERVOS_CH0 {LEDC_CHANNEL_0, 5},
|
||||
#define SERVOS_CH1 {LEDC_CHANNEL_1, 6}
|
||||
#define SERVOS_CH2
|
||||
#define SERVOS_CH3
|
||||
#define SERVOS_CH4
|
||||
#define SERVOS_CH5
|
||||
#define SERVOS_CH6
|
||||
|
||||
#define WS_RX_BUFFER_LEN 512
|
||||
#define WS_URL "ws://10.254.0.1:8080/"
|
||||
|
||||
#define LOGGER_BUFFER_SIZE 65536
|
||||
|
||||
#endif
|
||||
28
rx_esp32/src/config.h.j2
Normal file
28
rx_esp32/src/config.h.j2
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define TARGET_TX 0
|
||||
#define TARGET_RX 1
|
||||
#define TARGET {% if target == "tx" %}TARGET_TX{% else %}TARGET_RX{% endif %}
|
||||
|
||||
#define WIFI_SSID "MBCBootjes"
|
||||
#define WIFI_AUTH WIFI_AUTH_WPA_WPA2_PSK
|
||||
#define WIFI_PASS "hetgrootedok"
|
||||
|
||||
#define BOAT_NAME "Test boat"
|
||||
static uint8_t BoatId = 1;
|
||||
|
||||
#define HISTORY // enable cli history
|
||||
|
||||
#define SERVOS_CH0_PIN 7
|
||||
#define SERVOS_CH1_PIN 21
|
||||
|
||||
#define WS_RX_BUFFER_LEN 1024
|
||||
#define WS_TX_BUFFER_LEN 128
|
||||
#define WS_URL "ws://10.254.0.1:8080/"
|
||||
|
||||
#define LOGGER_BUFFER_SIZE 65536
|
||||
|
||||
#endif
|
||||
@@ -21,6 +21,12 @@ void logger_printf(const char *fmt, ...)
|
||||
|
||||
puts(&Logger_buff[Logger_buff_wp]);
|
||||
Logger_buff_wp += len + 1;
|
||||
|
||||
if (Logger_buff_wp >= LOGGER_BUFFER_SIZE)
|
||||
{
|
||||
logger_clearBuffer();
|
||||
LOG_W("buffer cleard, becouse it was full");
|
||||
}
|
||||
}
|
||||
|
||||
void logger_printFullLog(CLI_t* cli)
|
||||
|
||||
@@ -14,10 +14,14 @@
|
||||
#include "utils.h"
|
||||
#include "commands.h"
|
||||
#include "wifi.h"
|
||||
#include "led.h"
|
||||
#include "servos.h"
|
||||
#include "logger.h"
|
||||
#include "ws.h"
|
||||
#if TARGET == TARGET_TX
|
||||
#include "led.h"
|
||||
#include "adc.h"
|
||||
#elif TARGET == TARGET_RX
|
||||
#include "servos.h"
|
||||
#endif
|
||||
|
||||
bool volatile running = true;
|
||||
CMDList_t* cmdList;
|
||||
@@ -27,14 +31,33 @@ bool rxBuffer_overflow = false;
|
||||
typedef enum {
|
||||
STATE_WIFI_CONNECTING,
|
||||
STATE_WIFI_WAIT_CONNECTION,
|
||||
#if TARGET == TARGET_RX
|
||||
STATE_WS_CONNECTING,
|
||||
STATE_WS_WAIT_CONNECTION,
|
||||
STATE_IDEL,
|
||||
STATE_DRIVING
|
||||
#elif TARGET == TARGET_TX
|
||||
STATE_WIFI_CONNECTED,
|
||||
#endif
|
||||
} MainState_t;
|
||||
MainState_t MainState = STATE_WIFI_CONNECTING;
|
||||
|
||||
#if TARGET == TARGET_TX
|
||||
typedef enum {
|
||||
STATE_WS_CONNECTING,
|
||||
STATE_WS_WAIT_CONNECTION,
|
||||
STATE_IDEL,
|
||||
STATE_DRIVING
|
||||
} WSState_t;
|
||||
WSState_t WSStates[3] = {STATE_WS_CONNECTING, STATE_WS_CONNECTING, STATE_WS_CONNECTING};
|
||||
uint8_t WS_conn_proc = 0;
|
||||
#endif
|
||||
|
||||
#if TARGET == TARGET_RX
|
||||
ws_client_t ws_client;
|
||||
#elif TARGET == TARGET_TX
|
||||
ws_client_t ws_client[3];
|
||||
#endif
|
||||
|
||||
int charOut_uart(const char* c)
|
||||
{
|
||||
@@ -42,23 +65,18 @@ int charOut_uart(const char* c)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if TARGET == TARGET_RX
|
||||
int charOut_ws(const char* c)
|
||||
{
|
||||
ws_putchar(ws_client, *c);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void app_main() {
|
||||
// disable watchdog
|
||||
ESP_ERROR_CHECK(esp_task_wdt_deinit());
|
||||
|
||||
// wait so I have time to open the serial monitor
|
||||
// for (unsigned long i=0; i < 10000; i++)
|
||||
// {
|
||||
// printf(".");
|
||||
// }
|
||||
// printf("\n");
|
||||
|
||||
/* Initialize NVS — it is used to store PHY calibration data */
|
||||
esp_err_t ret = nvs_flash_init();
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
|
||||
@@ -70,11 +88,16 @@ void app_main() {
|
||||
|
||||
printChipInfo();
|
||||
|
||||
#if TARGET == TARGET_TX
|
||||
led_init();
|
||||
led_setRGB(0, 0, 20);
|
||||
#elif TARGET == TARGET_RX
|
||||
servo_init();
|
||||
#endif
|
||||
|
||||
wifiInit();
|
||||
bool adc_inited = false;
|
||||
uint8_t adc_counter = 0;
|
||||
|
||||
running = true;
|
||||
|
||||
@@ -85,7 +108,12 @@ void app_main() {
|
||||
uint8_t charIn = 0;
|
||||
EventBits_t bits;
|
||||
MainState_t lastMainState = MainState;
|
||||
#if TARGET == TARGET_RX
|
||||
CLI_t cli_ws_client;
|
||||
#elif TARGET == TARGET_TX
|
||||
CLI_t cli_ws_client[3];
|
||||
#endif
|
||||
|
||||
LOG_D("main: main loop starting in state %d", MainState);
|
||||
while (running)
|
||||
{
|
||||
@@ -111,59 +139,163 @@ void app_main() {
|
||||
bits = xEventGroupGetBits(s_wifi_event_group);
|
||||
if ((bits & WIFI_CONNECTED_BIT) != 0)
|
||||
{
|
||||
#if TARGET == TARGET_TX
|
||||
led_setRGB(0, 20, 0);
|
||||
MainState = STATE_WIFI_CONNECTED;
|
||||
#elif TARGET == TARGET_RX
|
||||
MainState = STATE_WS_CONNECTING;
|
||||
#endif
|
||||
LOG_I("main: connected to ap SSID '%s'", WIFI_SSID);
|
||||
}
|
||||
else if ((bits & WIFI_FAIL_BIT) != 0)
|
||||
{
|
||||
#if TARGET == TARGET_TX
|
||||
led_setRGB(2, 0, 0);
|
||||
#endif
|
||||
MainState = STATE_WIFI_CONNECTING;
|
||||
// wifi_reconnect();
|
||||
LOG_E("main: Failed to connect to SSID '%s'", WIFI_SSID);
|
||||
}
|
||||
else if (bits != 0)
|
||||
{
|
||||
led_setRGB(2, 0, 0);
|
||||
#if TARGET == TARGET_TX
|
||||
led_setRGB(20, 0, 0);
|
||||
#endif
|
||||
// MainState = STATE_WIFI_CONNECTING;
|
||||
LOG_C("main: UNEXPECTED EVENT (bits: 0x%04x)", bits);
|
||||
}
|
||||
break;
|
||||
|
||||
#if TARGET == TARGET_TX
|
||||
case STATE_WIFI_CONNECTED:
|
||||
if (!adc_inited)
|
||||
{
|
||||
adc_init();
|
||||
adc_inited = true;
|
||||
}
|
||||
ADC_Data_t adc_data;
|
||||
bool adc_data_valid = false;
|
||||
if (adc_read(&adc_data))
|
||||
{
|
||||
adc_counter++;
|
||||
if (adc_counter >= 20)
|
||||
{
|
||||
// LOG_D("ADC_DATA: %d, %d, %d, %d, %d, %d", adc_data.value[0], adc_data.value[1], adc_data.value[2], adc_data.value[3], adc_data.value[4], adc_data.value[5]);
|
||||
adc_data_valid = true;
|
||||
adc_counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (WS_conn_proc = 0; WS_conn_proc <3; WS_conn_proc++)
|
||||
{
|
||||
switch (WSStates[WS_conn_proc])
|
||||
{
|
||||
case STATE_WS_CONNECTING:
|
||||
LOG_I("main: websocket %d: connecting", WS_conn_proc);
|
||||
ws_client[WS_conn_proc] = ws_connect(WS_URL, BoatId + WS_conn_proc, WS_DEV_CODE_CLIENT);
|
||||
WSStates[WS_conn_proc] = STATE_WS_WAIT_CONNECTION;
|
||||
break;
|
||||
case STATE_WS_WAIT_CONNECTION:
|
||||
if (ws_client[WS_conn_proc]->connected)
|
||||
{
|
||||
LOG_I("main: websocket %d: connected", WS_conn_proc);
|
||||
WSStates[WS_conn_proc] = STATE_IDEL;
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE_IDEL:
|
||||
if (adc_data_valid)
|
||||
{
|
||||
char cmd[100];
|
||||
snprintf(&cmd[0], 100, "%04u;ctrl;%04u",
|
||||
ws_client[WS_conn_proc]->id,
|
||||
ws_client[WS_conn_proc]->id
|
||||
);
|
||||
ws_sendString(ws_client[WS_conn_proc], &cmd[0]);
|
||||
}
|
||||
case STATE_DRIVING:
|
||||
if (!ws_client[WS_conn_proc]->connected)
|
||||
{
|
||||
WSStates[WS_conn_proc] = STATE_WS_WAIT_CONNECTION;
|
||||
}
|
||||
|
||||
char ws_resp[10];
|
||||
uint16_t ws_resp_len;
|
||||
while ((ws_resp_len = ws_getstr(ws_client[WS_conn_proc], 10, &ws_resp[0])) > 0)
|
||||
{
|
||||
LOG_D("main: websocket %d: resv: %.*s", WS_conn_proc, ws_resp_len, ws_resp);
|
||||
if (ws_resp_len == 4)
|
||||
{
|
||||
ws_resp[4] = 0;
|
||||
if (strcmp(&ws_resp[0], "FAIL") == 0)
|
||||
{
|
||||
WSStates[WS_conn_proc] = STATE_IDEL;
|
||||
}
|
||||
}
|
||||
else if (ws_resp_len == 2)
|
||||
{
|
||||
ws_resp[2] = 0;
|
||||
if (strcmp(&ws_resp[0], "OK") == 0)
|
||||
{
|
||||
WSStates[WS_conn_proc] = STATE_DRIVING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((WSStates[WS_conn_proc] == STATE_DRIVING) && adc_data_valid)
|
||||
{
|
||||
char ctrl_cmd[100];
|
||||
snprintf(&ctrl_cmd[0], 100, "%04u;d;%u,%u",
|
||||
ws_client[WS_conn_proc]->id,
|
||||
adc_data.value[WS_conn_proc][0] >> 4,
|
||||
adc_data.value[WS_conn_proc][1] >> 4
|
||||
);
|
||||
ws_sendString(ws_client[WS_conn_proc], &ctrl_cmd[0]);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#elif TARGET == TARGET_RX
|
||||
case STATE_WS_CONNECTING:
|
||||
ws_client = ws_connect(WS_URL);
|
||||
cli_ws_client = CLI_init((CLI_charOutFn)&ws_putchar, cmdList);
|
||||
ws_client = ws_connect(WS_URL, BoatId, WS_DEV_CODE_BOAT);
|
||||
MainState = STATE_WS_WAIT_CONNECTION;
|
||||
break;
|
||||
case STATE_WS_WAIT_CONNECTION:
|
||||
if (ws_client->connected)
|
||||
{
|
||||
cli_ws_client = CLI_init((CLI_charOutFn)&charOut_ws, cmdList);
|
||||
cli_ws_client.echo = false;
|
||||
MainState = STATE_IDEL;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case STATE_IDEL:
|
||||
case STATE_DRIVING:
|
||||
if (!ws_client->connected)
|
||||
{
|
||||
CLI_deinit(&cli_ws_client);
|
||||
MainState = STATE_WS_WAIT_CONNECTION;
|
||||
}
|
||||
|
||||
charIn = ws_getchar(ws_client);
|
||||
if (charIn != 255)
|
||||
while ((charIn = ws_getchar(ws_client)) != 255)
|
||||
{
|
||||
CLI_charIn(&cli_ws_client, charIn);
|
||||
}
|
||||
ws_sendData(ws_client);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET == TARGET_TX
|
||||
led_setRGB(0, 0, 0);
|
||||
#endif
|
||||
|
||||
#if TARGET == TARGET_RX
|
||||
servo_deinit();
|
||||
#endif
|
||||
CLI_deinit(&cli_uart);
|
||||
CMDList_deinit(cmdList);
|
||||
|
||||
|
||||
@@ -14,27 +14,33 @@
|
||||
#define SERVO_DUTY_MIN ( 410) // 2**13 * (1000/20000) // 1000us of the 20ms
|
||||
#define SERVO_DUTY_MAX ( 819) // 2**13 * (2000/20000) // 2000us of the 20ms
|
||||
// #define SERVO_DUTY_MAX (1024) // 2**13 * (2500/20000) // 2500us of the 20ms
|
||||
#define SERVO_DUTY_DEFUALT ( 614) // 2**13 * (1500/20000) // 2500us of the 20ms
|
||||
#define SERVO_DUTY_MID ( 614) // 2**13 * (1500/20000) // 1500us of the 20ms
|
||||
|
||||
#define SERVO_DUTY_DIFF (SERVO_DUTY_MAX - SERVO_DUTY_MIN)
|
||||
|
||||
typedef struct ServoCh_t {
|
||||
ledc_channel_t channel;
|
||||
int gpio;
|
||||
} ServoCh_t;
|
||||
|
||||
static ServoCh_t Server_chs[] = {
|
||||
SERVOS_CH0
|
||||
SERVOS_CH1
|
||||
SERVOS_CH2
|
||||
SERVOS_CH3
|
||||
SERVOS_CH4
|
||||
SERVOS_CH5
|
||||
SERVOS_CH6
|
||||
};
|
||||
servo_config_t Servos[2];
|
||||
bool Servos_ch_swap = false;
|
||||
|
||||
void servo_init(void)
|
||||
{
|
||||
Servos[0].pin = SERVOS_CH0_PIN;
|
||||
Servos[0].ledc_ch = LEDC_CHANNEL_0;
|
||||
Servos[0].pulse_min = SERVO_DUTY_MIN;
|
||||
Servos[0].pulse_mid = SERVO_DUTY_MID;
|
||||
Servos[0].pulse_max = SERVO_DUTY_MAX;
|
||||
Servos[0].mid_delay = 0;
|
||||
Servos[0].mid_delay_timer = 0;
|
||||
Servos[0].reversed = false;
|
||||
|
||||
Servos[1].pin = SERVOS_CH1_PIN;
|
||||
Servos[1].ledc_ch = LEDC_CHANNEL_1;
|
||||
Servos[1].pulse_min = SERVO_DUTY_MIN;
|
||||
Servos[1].pulse_mid = SERVO_DUTY_MID;
|
||||
Servos[1].pulse_max = SERVO_DUTY_MAX;
|
||||
Servos[1].mid_delay = 5;
|
||||
Servos[1].mid_delay_timer = 0;
|
||||
Servos[1].reversed = true;
|
||||
|
||||
// Prepare and then apply the LEDC PWM timer configuration
|
||||
ledc_timer_config_t ledc_timer = {
|
||||
.speed_mode = SERVO_LEDC_MODE,
|
||||
@@ -45,35 +51,81 @@ void servo_init(void)
|
||||
};
|
||||
ledc_timer_config(&ledc_timer);
|
||||
|
||||
for (int i = sizeof(Server_chs)/sizeof(ServoCh_t)-1; i >= 0; i--)
|
||||
for (int i = sizeof(Servos)/sizeof(servo_config_t)-1; i >= 0; i--)
|
||||
{
|
||||
// Prepare and then apply the LEDC PWM channel configuration
|
||||
ledc_channel_config_t ledc_channel = {
|
||||
.speed_mode = SERVO_LEDC_MODE,
|
||||
.channel = Server_chs[i].channel,
|
||||
.channel = Servos[i].ledc_ch,
|
||||
.timer_sel = SERVO_LEDC_TIMER,
|
||||
.intr_type = LEDC_INTR_DISABLE,
|
||||
.gpio_num = Server_chs[i].gpio,
|
||||
.duty = SERVO_DUTY_DEFUALT, // Set duty to 0%
|
||||
.gpio_num = Servos[i].pin,
|
||||
.duty = Servos[i].pulse_mid,
|
||||
.hpoint = 0
|
||||
};
|
||||
ledc_channel_config(&ledc_channel);
|
||||
LOG_D("servo_init: inited servo channel %d (ledc: %u, gpio: %d)", i, Server_chs[i].channel, Server_chs[i].gpio);
|
||||
LOG_D("servo_init: inited servo channel %d (ledc: %u, gpio: %d)", i, Servos[i].ledc_ch, Servos[i].pin);
|
||||
}
|
||||
}
|
||||
void servo_deinit(void)
|
||||
{
|
||||
ledc_timer_pause(SERVO_LEDC_MODE, SERVO_LEDC_TIMER);
|
||||
for (int i = sizeof(Server_chs)/sizeof(ServoCh_t)-1; i > 0; i--)
|
||||
for (int i = sizeof(Servos)/sizeof(servo_config_t)-1; i >= 0; i--)
|
||||
{
|
||||
ledc_stop(SERVO_LEDC_MODE, Server_chs[i].channel, 0);
|
||||
ledc_stop(SERVO_LEDC_MODE, Servos[i].ledc_ch, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void servo_set(uint8_t ch, int16_t pos)
|
||||
void servo_set(uint8_t ch, uint8_t pos)
|
||||
{
|
||||
uint32_t duty = (uint32_t) ((double)pos * (double)SERVO_DUTY_DIFF/(double)INT16_MAX);
|
||||
duty += (SERVO_DUTY_MIN + SERVO_DUTY_DIFF/2);
|
||||
if (Servos_ch_swap)
|
||||
{
|
||||
ch = (ch == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
double pos_double = ((int16_t)pos - 128) / 128.0;
|
||||
|
||||
if (Servos[ch].reversed)
|
||||
{
|
||||
pos_double = -pos_double;
|
||||
}
|
||||
|
||||
|
||||
if (pos_double < 0.0)
|
||||
{
|
||||
if (Servos[ch].mid_delay_timer > 0)
|
||||
{
|
||||
Servos[ch].mid_delay_timer--;
|
||||
pos_double = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Servos[ch].mid_delay_timer = -Servos[ch].mid_delay;
|
||||
}
|
||||
}
|
||||
else if (pos_double > 0.0)
|
||||
{
|
||||
if (Servos[ch].mid_delay_timer < 0)
|
||||
{
|
||||
Servos[ch].mid_delay_timer++;
|
||||
pos_double = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Servos[ch].mid_delay_timer = Servos[ch].mid_delay;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t duty;
|
||||
if (pos_double > 0.0)
|
||||
{
|
||||
duty = (pos_double * (Servos[ch].pulse_max - Servos[ch].pulse_mid)) + Servos[ch].pulse_mid;
|
||||
}
|
||||
else
|
||||
{
|
||||
duty = (pos_double * (Servos[ch].pulse_mid - Servos[ch].pulse_min)) + Servos[ch].pulse_mid;
|
||||
}
|
||||
|
||||
if (duty < SERVO_DUTY_MIN)
|
||||
{
|
||||
duty = SERVO_DUTY_MIN;
|
||||
@@ -82,6 +134,6 @@ void servo_set(uint8_t ch, int16_t pos)
|
||||
{
|
||||
duty = SERVO_DUTY_MAX;
|
||||
}
|
||||
ledc_set_duty(SERVO_LEDC_MODE, Server_chs[ch].channel, duty);
|
||||
ledc_update_duty(SERVO_LEDC_MODE, Server_chs[ch].channel);
|
||||
ledc_set_duty(SERVO_LEDC_MODE, Servos[ch].ledc_ch, duty);
|
||||
ledc_update_duty(SERVO_LEDC_MODE, Servos[ch].ledc_ch);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,26 @@
|
||||
#define SERVOS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <driver/ledc.h>
|
||||
|
||||
typedef struct {
|
||||
int pin;
|
||||
ledc_channel_t ledc_ch;
|
||||
uint16_t pulse_min;
|
||||
uint16_t pulse_mid;
|
||||
uint16_t pulse_max;
|
||||
uint8_t mid_delay;
|
||||
int16_t mid_delay_timer;
|
||||
bool reversed;
|
||||
} servo_config_t;
|
||||
extern servo_config_t Servos[2];
|
||||
|
||||
extern bool Servos_ch_swap;
|
||||
|
||||
void servo_init(void);
|
||||
void servo_deinit(void);
|
||||
void servo_set(uint8_t ch, int16_t pos);
|
||||
void servo_set(uint8_t ch, uint8_t pos);
|
||||
|
||||
#endif // SERVOS_H
|
||||
@@ -16,12 +16,12 @@ static void ws_event_handler(void* handler_args, esp_event_base_t base, int32_t
|
||||
{
|
||||
case WEBSOCKET_EVENT_CONNECTED:
|
||||
LOG_I("ws_event_handler: connected");
|
||||
client->connected = true;
|
||||
|
||||
char str[100];
|
||||
snprintf(&str[0], 100, "%04d;3440;" BOAT_NAME "\n", BoatId);
|
||||
esp_websocket_client_send_text(client->handle, &str[0], strlen(str), 1000);
|
||||
snprintf(&str[0], 100, "%04u;%04u;" BOAT_NAME "\n", client->id, client->dev_code);
|
||||
esp_websocket_client_send_text(client->handle, &str[0], strlen(str), 1000);
|
||||
|
||||
client->connected = true;
|
||||
break;
|
||||
case WEBSOCKET_EVENT_DISCONNECTED:
|
||||
LOG_W("ws_event_handler: disconnected");
|
||||
@@ -42,21 +42,23 @@ static void ws_event_handler(void* handler_args, esp_event_base_t base, int32_t
|
||||
break;
|
||||
|
||||
case WEBSOCKET_EVENT_DATA:
|
||||
LOG_D("ws_event_handler: data recieved (opcode=%02x)", data->op_code);
|
||||
if (data->op_code == 0x2)
|
||||
LOG_D("ws_event_handler: data recieved opcode %d", data->op_code);
|
||||
if (data->op_code == 0x02)
|
||||
{
|
||||
LOG_D("ws_event_handler: binary data recieved");
|
||||
// ESP_LOG_BUFFER_HEX("Received binary data", data->data_ptr, data->data_len);
|
||||
}
|
||||
}
|
||||
else if (data->op_code == 0x08 && data->data_len == 2)
|
||||
{
|
||||
LOG_W("ws_event_handler: recieved closed message (code: %d)", (((int16_t)(data->data_ptr[0]))<<8) + data->data_ptr[1]);
|
||||
// ESP_LOGW(TAG, "Received closed message with code=%d", 256 * data->data_ptr[0] + data->data_ptr[1]);
|
||||
}
|
||||
else
|
||||
}
|
||||
else if (data->op_code == 0x09 || data->op_code == 0x0A)
|
||||
{ // pong or pong packet
|
||||
// do nothing, handled by esp_websocket
|
||||
}
|
||||
else if (data->op_code == 0x01 && data->data_len > 0)
|
||||
{
|
||||
LOG_D("ws_event_handler: data recieved (opcode: %d, size: %d): %.*s", data->op_code, data->data_len, data->data_len, (char*) data->data_ptr);
|
||||
uint16_t sizeLeft = WS_RX_BUFFER_LEN + client->rxBuffer_rp - client->rxBuffer_wp;
|
||||
// LOG_D("ws_event_handler: cmd recieved (len: %d): '%.*s'", data->data_len, data->data_len, (char*) data->data_ptr);
|
||||
uint16_t sizeLeft = WS_RX_BUFFER_LEN + client->rxBuffer_rp - client->rxBuffer_wp - 1;
|
||||
if (sizeLeft > WS_RX_BUFFER_LEN)
|
||||
{
|
||||
sizeLeft -= WS_RX_BUFFER_LEN;
|
||||
@@ -64,22 +66,31 @@ static void ws_event_handler(void* handler_args, esp_event_base_t base, int32_t
|
||||
|
||||
if (data->data_len <= sizeLeft)
|
||||
{
|
||||
if (WS_RX_BUFFER_LEN - client->rxBuffer_wp <= data->data_len)
|
||||
uint16_t leftOnEnd = WS_RX_BUFFER_LEN - client->rxBuffer_wp;
|
||||
if (leftOnEnd > data->data_len)
|
||||
{
|
||||
memcpy(&client->rxBuffer[client->rxBuffer_wp], data->data_ptr, data->data_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(&client->rxBuffer[client->rxBuffer_wp], data->data_ptr, sizeLeft);
|
||||
memcpy(&client->rxBuffer[0], data->data_ptr + sizeLeft, data->data_len - sizeLeft);
|
||||
memcpy(&client->rxBuffer[client->rxBuffer_wp], data->data_ptr, leftOnEnd);
|
||||
memcpy(&client->rxBuffer[0], data->data_ptr + leftOnEnd, data->data_len - leftOnEnd);
|
||||
}
|
||||
client->rxBuffer_wp += data->data_len;
|
||||
if (client->rxBuffer_wp >= WS_RX_BUFFER_LEN)
|
||||
{
|
||||
client->rxBuffer_wp -= WS_RX_BUFFER_LEN;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("ws_event_handler: no space left in buffer. data ignored (free space: %u)", data->data_len, sizeLeft + client->rxBuffer_rp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_D("ws_event_handler: data recieved (opcode: 0x%02x, size: %d): '%.*s'", data->op_code, data->data_len, data->data_len, (char*) data->data_ptr);
|
||||
}
|
||||
break;
|
||||
case WEBSOCKET_EVENT_ERROR:
|
||||
if (data->error_handle.esp_ws_handshake_status_code != 0)
|
||||
@@ -94,14 +105,23 @@ static void ws_event_handler(void* handler_args, esp_event_base_t base, int32_t
|
||||
LOG_E("ws_event_handler: captured as transport's socket errno %d", data->error_handle.esp_transport_sock_errno);
|
||||
}
|
||||
break;
|
||||
case WEBSOCKET_EVENT_BEFORE_CONNECT:
|
||||
LOG_D("ws_event_handler: event before connect fired");
|
||||
break;
|
||||
default:
|
||||
LOG_D("ws_event_handler: a unkown event happened: %d", event_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ws_client_t ws_connect(char *url)
|
||||
ws_client_t ws_connect(char *url, uint16_t id, uint16_t dev_code)
|
||||
{
|
||||
ws_client_t client = malloc(sizeof(ws_client_data_t));
|
||||
client->id = id;
|
||||
client->dev_code = dev_code;
|
||||
client->rxBuffer_rp = 0;
|
||||
client->rxBuffer_wp = 0;
|
||||
client->txBuffer_wp = 0;
|
||||
memset(&(client->rxBuffer[0]), 0, WS_RX_BUFFER_LEN);
|
||||
|
||||
const esp_websocket_client_config_t ws_conf = {
|
||||
@@ -121,7 +141,7 @@ int ws_getchar(ws_client_t client)
|
||||
if (client->rxBuffer_rp != client->rxBuffer_wp)
|
||||
{
|
||||
out = client->rxBuffer[client->rxBuffer_rp];
|
||||
client->rxBuffer_rp++;
|
||||
client->rxBuffer_rp++;
|
||||
if (client->rxBuffer_rp >= WS_RX_BUFFER_LEN)
|
||||
{
|
||||
client->rxBuffer_rp = 0;
|
||||
@@ -130,7 +150,75 @@ int ws_getchar(ws_client_t client)
|
||||
return out;
|
||||
}
|
||||
|
||||
int ws_getstr(ws_client_t client, uint16_t max_size, char *str)
|
||||
{
|
||||
uint16_t out = 0;
|
||||
if (client->rxBuffer_rp != client->rxBuffer_wp)
|
||||
{
|
||||
out = WS_RX_BUFFER_LEN + client->rxBuffer_wp - client->rxBuffer_rp;
|
||||
if (out > WS_RX_BUFFER_LEN)
|
||||
{
|
||||
out -= WS_RX_BUFFER_LEN;
|
||||
}
|
||||
if (out > max_size)
|
||||
{
|
||||
out = max_size;
|
||||
}
|
||||
|
||||
if (client->rxBuffer_rp < client->rxBuffer_wp)
|
||||
{
|
||||
memcpy(str, &client->rxBuffer[client->rxBuffer_rp], out);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16_t sizeUntilEnd = WS_RX_BUFFER_LEN - client->rxBuffer_rp;
|
||||
if (sizeUntilEnd >= out)
|
||||
{
|
||||
memcpy(str, &client->rxBuffer[client->rxBuffer_rp], out);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(str, &client->rxBuffer[client->rxBuffer_rp], sizeUntilEnd);
|
||||
memcpy(str + sizeUntilEnd, &client->rxBuffer[0], out - sizeUntilEnd);
|
||||
}
|
||||
}
|
||||
client->rxBuffer_rp += out;
|
||||
if (client->rxBuffer_rp >= WS_RX_BUFFER_LEN)
|
||||
{
|
||||
client->rxBuffer_rp -= WS_RX_BUFFER_LEN;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
void ws_putchar(ws_client_t client, char c)
|
||||
{
|
||||
esp_websocket_client_send_text(client->handle, &c, 1, 1000); //TODO: convert RTOS tick in ms
|
||||
if (client->txBuffer_wp == WS_TX_BUFFER_LEN)
|
||||
{
|
||||
ws_sendData(client);
|
||||
|
||||
if (client->txBuffer_wp == WS_TX_BUFFER_LEN)
|
||||
{
|
||||
LOG_E("ws_sendData: no space left in tx buffer. data ignored");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
client->txBuffer[client->txBuffer_wp] = c;
|
||||
client->txBuffer_wp++;
|
||||
}
|
||||
|
||||
void ws_sendData(ws_client_t client)
|
||||
{
|
||||
if ((client->txBuffer_wp > 0) && esp_websocket_client_is_connected(client->handle))
|
||||
{
|
||||
LOG_D("ws_sendData: (%d b) '%.*s'", client->txBuffer_wp, client->txBuffer_wp, (char *)&client->txBuffer[0]);
|
||||
esp_websocket_client_send_text(client->handle, (char *)&client->txBuffer[0], client->txBuffer_wp, 1000 * portTICK_PERIOD_MS);
|
||||
client->txBuffer_wp = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ws_sendString(ws_client_t client, const char *str)
|
||||
{
|
||||
esp_websocket_client_send_text(client->handle, str, strlen(str), 1000 * portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
@@ -7,17 +7,27 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define WS_DEV_CODE_BOAT 3440
|
||||
#define WS_DEV_CODE_CLIENT 4675
|
||||
|
||||
typedef struct {
|
||||
esp_websocket_client_handle_t handle;
|
||||
int connected;
|
||||
unsigned char rxBuffer[WS_RX_BUFFER_LEN];
|
||||
uint16_t rxBuffer_wp;
|
||||
uint16_t rxBuffer_rp;
|
||||
unsigned char txBuffer[WS_TX_BUFFER_LEN];
|
||||
uint16_t txBuffer_wp;
|
||||
uint16_t id;
|
||||
uint16_t dev_code;
|
||||
} ws_client_data_t;
|
||||
typedef ws_client_data_t* ws_client_t;
|
||||
|
||||
ws_client_t ws_connect(char *url);
|
||||
ws_client_t ws_connect(char *url, uint16_t id, uint16_t dev_code);
|
||||
int ws_getchar(ws_client_t client);
|
||||
int ws_getstr(ws_client_t client, uint16_t max_len, char *str);
|
||||
void ws_putchar(ws_client_t client, char c);
|
||||
void ws_sendData(ws_client_t client);
|
||||
void ws_sendString(ws_client_t client, const char *str);
|
||||
|
||||
#endif
|
||||
|
||||
BIN
tx_case/tx_case.FCStd
Normal file
BIN
tx_case/tx_case.FCStd
Normal file
Binary file not shown.
Reference in New Issue
Block a user