X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Ftriface%2Fprotocol.c;h=156a414bc802983c28bc6a3f2d0f0ba43ba94497;hb=e1fa8a6e8b036732e1bf86332c87b82677cd9a2a;hp=1f630a1b3e9ea97835e2ee031167782cd968d4df;hpb=2aa5b04dcc5daad2409bf2027541704b56a85f13;p=bertos.git diff --git a/examples/triface/protocol.c b/examples/triface/protocol.c index 1f630a1b..156a414b 100644 --- a/examples/triface/protocol.c +++ b/examples/triface/protocol.c @@ -45,6 +45,7 @@ #include "protocol.h" #include "cmd_ctor.h" // MAKE_CMD, REGISTER_CMD #include "verstag.h" + #include "hw/hw_adc.h" #include "hw/hw_input.h" @@ -83,6 +84,8 @@ static bool interactive; /// Readline context, used for interactive mode. static struct RLContext rl_ctx; +static Sipo fd_sipo; + uint8_t reg_status_dout; /** * Send a NAK asking the host to send the current message again. @@ -280,7 +283,7 @@ MAKE_CMD(ping, "", "", /* Dout */ MAKE_CMD(dout, "d", "", ({ - sipo_putchar((uint8_t)args[1].l); + kfile_write(&fd_sipo.fd, (uint8_t *)&args[1].l, 1); //Store status of dout ports. reg_status_dout = (uint8_t)args[1].l; @@ -356,6 +359,9 @@ static void protocol_registerCmds(void) /* Initialization: readline context, parser and register commands. */ void protocol_init(KFile *fd) { + /* SPI Port Initialization */ + sipo_init(&fd_sipo); + interactive = FORCE_INTERACTIVE; rl_init_ctx(&rl_ctx);