Skip to content

Instantly share code, notes, and snippets.

@zarya
Created September 28, 2014 14:36
Show Gist options
  • Save zarya/086dade06d8899fb3754 to your computer and use it in GitHub Desktop.
Save zarya/086dade06d8899fb3754 to your computer and use it in GitHub Desktop.
void ICACHE_FLASH_ATTR
at_exeCmdGPIO(uint8_t id, char *pPara)
{
uint8_t on;
// uart0_sendStr("GPIO\r\n");
pPara++;
on = atoi(pPara);
if(on == 0)
{
gpio_output_set(0, BIT2, BIT2, 0);
// uart0_sendStr("GPIO CLR\r\n");
}
else if(on == 1)
{
gpio_output_set(BIT2, 0, BIT2, 0);
// uart0_sendStr("GPIO SET\r\n");
}
else if(on == 2)
{
os_timer_arm(&blinky, 200, 1);
// uart0_sendStr("GPIO SET\r\n");
}
else if(on == 3)
{
os_timer_disarm(&blinky);
// uart0_sendStr("GPIO SET\r\n");
}
else
{
// uart0_sendStr("GPIO ERROR\r\n");
at_backError;
return;
}
at_backOk;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment