Skip to content

Commit

Permalink
test before push
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Sep 29, 2023
1 parent 984f5c0 commit 7138ee9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
26 changes: 23 additions & 3 deletions jacs_topwriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1113,9 +1113,29 @@ namespace jacs {
wr,
wr.emitBufLoad(NumFmt.F64, 12)
)
// TODO: ignore values in tiles.ts: car_commands
// TODO: special case on wall collision
filterValueIn(() => radioVar.read(wr))
// hack for keeping car radio from interfering with user radio
if (sensor.tid == microcode.TID_SENSOR_CAR_WALL) {
wr.emitIf(
wr.emitExpr(Op.EXPR2_LT, [
literal(0xfffff10),
radioVar.read(wr),
]),
() => {
radioVar.write(
wr,
wr.emitExpr(Op.EXPR2_SUB, [radioVar.read(wr), literal(0xfffff10)]))
filterValueIn(() => radioVar.read(wr))
})
} else {
wr.emitIf(
wr.emitExpr(Op.EXPR2_LT, [
radioVar.read(wr),
literal(0xfffff10)
]),
() => {
filterValueIn(() => radioVar.read(wr))
})
}
}
)
} else if (
Expand Down
5 changes: 4 additions & 1 deletion tiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ namespace microcode {

if (car_tiles) {
const wall = makeSensor(TID_SENSOR_CAR_WALL, "value_in", 500)
wall.serviceClassName = "radio"
wall.eventCode = 0x91
wall.jdKind = JdKind.Radio
wall.constraints.allow.categories = []
wall.constraints.allow.tiles = only5
wall.constraints.handling = { terminal: true }
wall.constraints.handling = { terminal: true }
}

const magnet = makeSensor(TID_SENSOR_MAGNET, "value_in", 500)
Expand Down

0 comments on commit 7138ee9

Please sign in to comment.