Skip to content

Commit

Permalink
merge complete...
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Oct 3, 2023
1 parent dd8896b commit 1592905
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
18 changes: 5 additions & 13 deletions jacs_topwriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,9 +1129,7 @@ namespace jacs {
wr.emitIf(
wr.emitExpr(Op.EXPR2_LT, [
literal(
microcode.robots
.RobotCompactCommand
.ObstacleState
microcode.robots.RobotCompactCommand.ObstacleState
),
radioVar.read(wr),
]),
Expand All @@ -1142,17 +1140,15 @@ namespace jacs {
wr.emitExpr(Op.EXPR2_SUB, [
radioVar.read(wr),
literal(
microcode.robots
.RobotCompactCommand
.ObstacleState
microcode.robots.RobotCompactCommand.ObstacleState
),
])
)
filterValueIn(() => radioVar.read(wr))
} else {
wr.emitIf(
wr.emitExpr(Op.EXPR2_LT, [
literal(0xfffff1f),
wr.emitExpr(Op.EXPR2_LE, [
literal(microcode.robots.RobotCompactCommand.LineState),
radioVar.read(wr),
]),
() => { filterValueIn(() => radioVar.read(wr)) }
Expand All @@ -1164,11 +1160,7 @@ namespace jacs {
wr.emitIf(
wr.emitExpr(Op.EXPR2_LT, [
radioVar.read(wr),
literal(
microcode.robots
.RobotCompactCommand
.ObstacleState
),
literal(microcode.robots.RobotCompactCommand.ObstacleState),
]),
() => {
filterValueIn(() =>
Expand Down
20 changes: 10 additions & 10 deletions tiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ namespace microcode {
addEvent(TID_FILTER_TEMP_WARMER, "temperature_event", 2)
addEvent(TID_FILTER_TEMP_COLDER, "temperature_event", 1)

if (car_tiles) {
const both = addEvent(TID_FILTER_LINE_BOTH, "line", 0xfffff23)
const left = addEvent(TID_FILTER_LINE_LEFT, "line", 0xfffff21)
const right = addEvent(TID_FILTER_LINE_RIGHT, "line", 0xfffff22)
const neither = addEvent(TID_FILTER_LINE_NEITHER, "line", 0xfffff20)
if (CAR_TILES) {
const both = addEvent(TID_FILTER_LINE_BOTH, "line", robots.RobotCompactCommand.Both)
const left = addEvent(TID_FILTER_LINE_LEFT, "line", robots.RobotCompactCommand.Left)
const right = addEvent(TID_FILTER_LINE_RIGHT, "line", robots.RobotCompactCommand.Right )
const neither = addEvent(TID_FILTER_LINE_NEITHER, "line", robots.RobotCompactCommand.LineState)
both.jdKind = left.jdKind = right.jdKind = neither.jdKind = JdKind.Literal

const line = makeSensor(TID_SENSOR_LINE, "line", 505)
Expand Down Expand Up @@ -534,11 +534,11 @@ namespace microcode {

if (CAR_TILES) {
const car_commands = [
microcode.robots.RobotCompactCommand.MotorRunForward, // forward
microcode.robots.RobotCompactCommand.MotorRunBackward, // reverse
microcode.robots.RobotCompactCommand.MotorTurnLeft, // left
microcode.robots.RobotCompactCommand.MotorTurnRight, // right
microcode.robots.RobotCompactCommand.MotorStop, // stop
microcode.robots.RobotCompactCommand.MotorRunForward,
microcode.robots.RobotCompactCommand.MotorRunBackward,
microcode.robots.RobotCompactCommand.MotorTurnLeft,
microcode.robots.RobotCompactCommand.MotorTurnRight,
microcode.robots.RobotCompactCommand.MotorStop,
]
make_vals(car_commands, "car", "CAR", 1)

Expand Down

0 comments on commit 1592905

Please sign in to comment.