Skip to content

Commit

Permalink
Merge pull request jeelabs#3 from jeelabs/master
Browse files Browse the repository at this point in the history
merge with upstream
  • Loading branch information
brunnels committed Aug 28, 2015
2 parents c68a281 + fb1d7f6 commit 38b0e2c
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 114 deletions.
2 changes: 1 addition & 1 deletion cmd/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ CMD_Exec(const CmdList *scp, CmdPacket *packet) {
uint32_t ret = scp->sc_function(packet);
// if requestor asked for a response, send it
if (packet->_return){
os_printf("CMD: Response: %lu, cmd: %d\r\n", ret, packet->cmd);
os_printf("CMD: Response: 0x%lx, cmd: %d\r\n", ret, packet->cmd);
crc = CMD_ResponseStart(packet->cmd, 0, ret, 0);
CMD_ResponseEnd(crc);
} else {
Expand Down
4 changes: 4 additions & 0 deletions cmd/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ CMD_WifiCb(uint8_t wifiStatus) {
// Command handler for Wifi connect command
static uint32_t ICACHE_FLASH_ATTR
CMD_WifiConnect(CmdPacket *cmd) {
os_printf("CMD: Wifi connect\n");
if(cmd->argc != 2 || cmd->callback == 0)
return 0xFFFFFFFF;

wifiStatusCb = CMD_WifiCb; // register our callback with wifi subsystem
wifiCallback = cmd->callback; // save the MCU's callback
// trigger an immediate callback with the current status
lastWifiStatus = 0xff;
CMD_WifiCb(wifiState);
return 1;
}
Loading

0 comments on commit 38b0e2c

Please sign in to comment.