mirror of
https://github.com/whowechina/chu_arcade.git
synced 2026-09-22 22:37:56 +03:00
Fix air tower switch order
This commit is contained in:
+2
-3
@@ -64,10 +64,9 @@ static inline uint8_t air_bits(int dist)
|
||||
{
|
||||
int offset= chu_cfg->tof.offset * 10;
|
||||
int pitch = chu_cfg->tof.pitch * 10;
|
||||
int bit1 = (dist - offset) / pitch;
|
||||
int bit2 = (dist - offset + pitch / 2) / pitch;
|
||||
int bit = (dist - offset) / pitch;
|
||||
|
||||
return ((1 << bit1) | (1 << bit2)) & 0x3f;
|
||||
return (1 << bit) & 0x3f;
|
||||
}
|
||||
|
||||
static inline bool dist_valid(int dist)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#define I2C_PORT i2c1
|
||||
#define I2C_SDA 26
|
||||
#define I2C_SCL 27
|
||||
#define I2C_FREQ 1333*1000
|
||||
#define I2C_FREQ 1367*1000
|
||||
|
||||
#define TOF_MUX_LIST { 3, 4, 5, 2, 1, 0, 11, 12, 13, 10, 9, 8}
|
||||
|
||||
|
||||
+3
-3
@@ -83,12 +83,12 @@ static void gen_joy_report()
|
||||
last_coin_pressed = coin_pressed;
|
||||
|
||||
uint16_t air[6][2] = {
|
||||
{ 0, 1 << 13 },
|
||||
{ 1 << 13, 0 },
|
||||
{ 0, 1 << 12 },
|
||||
{ 0, 1 << 13 },
|
||||
{ 1 << 12, 0 },
|
||||
{ 0, 1 << 11 },
|
||||
{ 0, 1 << 12 },
|
||||
{ 1 << 11, 0 },
|
||||
{ 0, 1 << 11 },
|
||||
};
|
||||
|
||||
uint8_t airkey = air_bitmap();
|
||||
|
||||
Reference in New Issue
Block a user