Skip to content

Commit

Permalink
fix megagenial (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
xgroleau authored Nov 26, 2021
1 parent 883a7c9 commit 724df2d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
13 changes: 3 additions & 10 deletions src/bittybuzz/buzz_scripts/behaviors/blinky.bzz
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
include "utils/executor.bzz"

ctx = {
.led = 0,
.hex = 0
.led = 0
}

function tick(context){
log("Led set to : ", context.led, " and hex set to :", context.hex);
log("Led set to : ", context.led);
ui.set_led(context.led);
ui.set_hex(context.hex);
ui.set_hex(neighbors.count());

# led = !led
if(context.led){
context.led = nil;
} else{
context.led = 1;
}

if(context.hex >= 15){
context.hex = 0;
} else {
context.hex = context.hex + 1;
}
}

function create_exec(delay_ms){
Expand Down
2 changes: 1 addition & 1 deletion src/bittybuzz/buzz_scripts/behaviors/follow_leader.bzz
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function tick_follow_leader(stig){
log("Trying to get leader: ", leader)
leader_obj = neighbors.get(leader) # Global to be accessible in filter
if (istable(leader_obj)){
if(leader_obj.distance > 1.25){
if(leader_obj.distance > 0.75){
# Getting neighbors in LOS
var obstructing_neighbors = neighbors.filter(function(rid, data){
if(rid != leader and data.distance < 1){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define RESPONSE_PROCESSING_GUARD 360U
#define RESPONSE_PROCESSING_GUARD_GUARD 50U
#define RESPONSE_TO_FINAL_GUARD 600U
#define FINAL_PROCESSING_GUARD 2000U
#define FINAL_PROCESSING_GUARD 5000U
#define RX_BEFORE_TX_GUARD_US 10U
#define TIMEOUT_GUARD_US 100U
#define DEAD_TIME 200U
Expand Down
2 changes: 1 addition & 1 deletion src/bsp/src/stm32/src/interloc/src/InterlocTimeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ uint64_t InterlocTimeManager::getPollTxStartTs(uint64_t startOfFrameTs) const {

uint32_t InterlocTimeManager::getSyncTimeoutUs() const {
uint32_t slotToSlotOffsetUs = getFrameLengthUs();
return slotToSlotOffsetUs * NUM_TWR_FRAMES + (m_bsp.generateRandomNumber() % 25) * 150;
return slotToSlotOffsetUs * NUM_TWR_FRAMES + (m_bsp.generateRandomNumber() % 25) * 500;
}

uint64_t InterlocTimeManager::getAngleTxStartTs(uint64_t startOfFrameTs, uint32_t angleId) const {
Expand Down

0 comments on commit 724df2d

Please sign in to comment.