Skip to content

Commit

Permalink
fix code gen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Sep 27, 2023
1 parent 7e01ed4 commit 5705aa4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace microcode {

function carImages(reg: name2Image) {
reg[TID_ACTUATOR_CAR] = icondb.car
reg[TID_ACTUATOR_CAR_FORWARD] = icondb.car_forward
reg[TID_ACTUATOR_CAR_REVERSE] = icondb.car_reverse
reg[TID_ACTUATOR_CAR_TURN_LEFT] = icondb.car_left_turn
reg[TID_ACTUATOR_CAR_TURN_RIGHT] = icondb.car_right_turn
reg[TID_ACTUATOR_CAR_STOP] = icondb.car_stop
reg[TID_MODIFIER_CAR_FORWARD] = icondb.car_forward
reg[TID_MODIFIER_CAR_REVERSE] = icondb.car_reverse
reg[TID_MODIFIER_CAR_TURN_LEFT] = icondb.car_left_turn
reg[TID_MODIFIER_CAR_TURN_RIGHT] = icondb.car_right_turn
reg[TID_MODIFIER_CAR_STOP] = icondb.car_stop
reg[TID_SENSOR_CAR_WALL] = icondb.car_wall
}

Expand Down
26 changes: 13 additions & 13 deletions tiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ namespace microcode {
export const TID_MODIFIER_SERVO_SET_ANGLE = "A21_"

export const TID_ACTUATOR_CAR = "CAR"
export const TID_ACTUATOR_CAR_FORWARD = "CAR1"
export const TID_ACTUATOR_CAR_REVERSE = "CAR2"
export const TID_ACTUATOR_CAR_TURN_LEFT = "CAR3"
export const TID_ACTUATOR_CAR_TURN_RIGHT = "CAR4"
export const TID_ACTUATOR_CAR_STOP = "CAR5"
export const TID_MODIFIER_CAR_FORWARD = "CAR1"
export const TID_MODIFIER_CAR_REVERSE = "CAR2"
export const TID_MODIFIER_CAR_TURN_LEFT = "CAR3"
export const TID_MODIFIER_CAR_TURN_RIGHT = "CAR4"
export const TID_MODIFIER_CAR_STOP = "CAR5"

export const PAGE_IDS = [
TID_MODIFIER_PAGE_1,
Expand Down Expand Up @@ -434,14 +434,6 @@ namespace microcode {
const swtch = addActuator(TID_ACTUATOR_SWITCH_PAGE, ["page"])
swtch.priority = 110

if (car_tiles) {
const car = addActuator(TID_ACTUATOR_CAR, ["car"])
car.priority = 200
car.jdKind = JdKind.Sequence
car.serviceClassName = "radio"
car.serviceCommand = 0x81
}

function addAssign(tid: string, id: number) {
const theVar = addActuator(tid, ["value_out", "constant"])
theVar.jdParam = id
Expand Down Expand Up @@ -514,6 +506,7 @@ namespace microcode {
m.constraints.handling.terminal = true
m.jdKind = JdKind.Page
})

if (car_tiles) {
const car_commands =
[ 0xfffff001, // forward
Expand All @@ -523,6 +516,13 @@ namespace microcode {
0xfffff005 // stop
]
make_vals(car_commands, "car", "CAR", 1)

const car = addActuator(TID_ACTUATOR_CAR, ["car"])
car.priority = 200
car.jdKind = JdKind.Sequence
car.serviceClassName = "radio"
car.serviceCommand = 0x81
car.defaultModifier = tilesDB.modifiers[TID_MODIFIER_CAR_STOP]
}

function addRGB(id: number, color: number) {
Expand Down

0 comments on commit 5705aa4

Please sign in to comment.