Skip to content
Merged

Dev #12

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Local scripts
liner.py
liner.py
tests/control_tests
.build/
review/
tuna_test/
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"type": "git",
"url": "https://github.com/nfrproducts/probot-lib"
},
"version": "0.1.4"
"version": "0.1.5"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=probot
version=0.1.4
version=0.1.5
author=Tuna Gül
maintainer=Tuna Gül <tunagul54@gmail.com>
sentence=ProBot Library for Robotics Competitions.
Expand Down
14 changes: 12 additions & 2 deletions src/platform/esp32s3/web/index_html.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const char MAIN_page[] PROGMEM = R"=====(
font-family:"Inter","Segoe UI",sans-serif;
}
*{margin:0;padding:0;box-sizing:border-box;}
#logging{display:none;} /* Logging section hidden for now */
body{
min-height:100vh;
background:var(--ice);
Expand Down Expand Up @@ -1340,8 +1341,15 @@ function stopAutoTimer(){
selectedGamepadIndex=parseInt(val,10);
if(isNaN(selectedGamepadIndex)) selectedGamepadIndex=-1;
}
let gamepadSending=false;
let lastGamepadSend=0;
const GAMEPAD_SEND_INTERVAL=20; // 50Hz max
async function sendGamepadData(gp){
const data={axes:gp.axes,buttons:gp.buttons.map(b=>b.pressed)};
const now=performance.now();
if(gamepadSending || (now-lastGamepadSend)<GAMEPAD_SEND_INTERVAL) return;
gamepadSending=true;
lastGamepadSend=now;
const data={axes:Array.from(gp.axes),buttons:gp.buttons.map(b=>b.pressed)};
try{
await fetch("/updateController",{
method:"POST",
Expand All @@ -1350,6 +1358,8 @@ function stopAutoTimer(){
});
}catch(err){
console.error(err);
}finally{
gamepadSending=false;
}
}
function displayJoystickData(gp){
Expand Down Expand Up @@ -1411,7 +1421,7 @@ if(loggingElements.autoScroll) loggingElements.autoScroll.addEventListener('chan
autoRemaining=parseFloat(document.getElementById('autoPeriod').value)||0;
updateAutoDisplay();
setPhaseDisplay('standby');
applyHeaderMode();
// applyHeaderMode(); // TODO: header mode switching removed for now
handleLoggingRefresh();
if(loggingElements.autoRefresh){
setLoggingAutoRefresh(loggingElements.autoRefresh.checked);
Expand Down
9 changes: 5 additions & 4 deletions src/probot/logging/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,13 +1010,14 @@ void notifySchedulerOverrun(uint32_t now_ms, uint32_t overrun_ms){

void configureDefaults(){
LoggingManager& mgr = LoggingManager::instance();
mgr.enableSerial(true);
mgr.enableSerial(false); // Default: kapalı
mgr.setSerialBandwidth(BandwidthMode::kNormal);
mgr.enableWifi(false);
mgr.setWifiBandwidth(BandwidthMode::kLow);
#ifndef PROBOT_LOGGER_NO_SCHED_ATTACH
control::attach(&mgr);
#endif
// Logger scheduler'a baglanmiyor - varsayilan olarak kapali
// #ifndef PROBOT_LOGGER_NO_SCHED_ATTACH
// control::attach(&mgr);
// #endif
}

void enableSerialLogging(bool enabled){
Expand Down