Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
replace tele_input_state with tele_get_input_state, remove global var
- Loading branch information
Showing
with
8 additions
and
15 deletions.
-
+2
−1
simulator/tt.c
-
+2
−4
src/main.c
-
+1
−5
src/teletype.c
-
+0
−3
src/teletype.h
-
+2
−1
src/teletype_io.h
-
+1
−1
tests/main.c
|
|
@@ -76,9 +76,10 @@ void tele_mute(uint8_t i, uint8_t s) { |
|
|
printf("\n"); |
|
|
} |
|
|
|
|
|
void tele_input_state(uint8_t n) { |
|
|
bool tele_get_input_state(uint8_t n) { |
|
|
printf("INPUT_STATE n:%" PRIu8, n); |
|
|
printf("\n"); |
|
|
return false; |
|
|
} |
|
|
|
|
|
int main() { |
|
|
|
|
|
@@ -90,8 +90,6 @@ typedef struct { |
|
|
|
|
|
aout_t aout[4]; |
|
|
|
|
|
volatile uint8_t input_states[8]; |
|
|
|
|
|
u8 mutes[8]; |
|
|
|
|
|
error_t status; |
|
|
@@ -2354,8 +2352,8 @@ void tele_mem_clear(void) { |
|
|
memset(&scene_text, 0, sizeof(scene_text)); |
|
|
} |
|
|
|
|
|
void tele_input_state(uint8_t n) { |
|
|
input_states[n] = gpio_get_pin_value(A00 + n); |
|
|
bool tele_get_input_state(uint8_t n) { |
|
|
return gpio_get_pin_value(A00 + n) > 0; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@@ -60,9 +60,6 @@ static char condition; |
|
|
static tele_command_t tele_stack[TELE_STACK_SIZE]; |
|
|
static uint8_t tele_stack_top; |
|
|
|
|
|
|
|
|
volatile uint8_t input_states[8]; |
|
|
|
|
|
const char *to_v(int16_t); |
|
|
|
|
|
void copy_command(tele_command_t *dst, tele_command_t *src); |
|
|
@@ -1660,8 +1657,7 @@ static void op_STATE(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), |
|
|
else if (a > 7) |
|
|
a = 7; |
|
|
|
|
|
tele_input_state(a); |
|
|
cs_push(cs, input_states[a]); |
|
|
cs_push(cs, tele_get_input_state(a)); |
|
|
} |
|
|
|
|
|
static void op_ER(const void *NOTUSED(data), scene_state_t *NOTUSED(ss), |
|
|
|
|
|
@@ -102,9 +102,6 @@ const char *to_v(int16_t); |
|
|
|
|
|
extern tele_pattern_t tele_patterns[4]; |
|
|
|
|
|
|
|
|
extern char error_detail[16]; |
|
|
|
|
|
extern volatile uint8_t input_states[8]; |
|
|
|
|
|
#endif |
|
|
@@ -1,6 +1,7 @@ |
|
|
#ifndef _TELETYPE_IO_H_ |
|
|
#define _TELETYPE_IO_H_ |
|
|
|
|
|
#include <stdbool.h> |
|
|
#include <stdint.h> |
|
|
|
|
|
// These functions are for interacting with the teletype hardware, each target |
|
|
@@ -19,6 +20,6 @@ extern void tele_pi(void); |
|
|
extern void tele_script(uint8_t a); |
|
|
extern void tele_kill(void); |
|
|
extern void tele_mute(uint8_t, uint8_t); |
|
|
extern void tele_input_state(uint8_t); |
|
|
extern bool tele_get_input_state(uint8_t); |
|
|
|
|
|
#endif |
|
|
@@ -21,7 +21,7 @@ void tele_pi() {} |
|
|
void tele_script(uint8_t a) {} |
|
|
void tele_kill() {} |
|
|
void tele_mute(uint8_t i, uint8_t s) {} |
|
|
void tele_input_state(uint8_t n) {} |
|
|
bool tele_get_input_state(uint8_t n) { return false; } |
|
|
|
|
|
GREATEST_MAIN_DEFS(); |
|
|
|
|
|
|