Changeset 601:b76ca6cf82fc

Show
Ignore:
Timestamp:
06/11/08 11:23:03 (7 months ago)
Author:
Maxime Petazzoni <maxime.petazzoni@…>
Branch:
default
Message:

Add the "end" and "nop" commands, doing nothing. Also fix
a bug in nx_rcmd_play() introduced by the API change of streq().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • nxos/base/lib/rcmd/rcmd.c

    r598 r601  
    2424static rcmd_err_t nx_rcmd_exec(char *line); 
    2525static rcmd_err_t nx_rcmd_wait(char *line); 
     26static rcmd_err_t nx_rcmd_nop(char *line); 
    2627 
    2728static rcmd_command_def rcmd_commands[] = { 
     
    3233  { "exec",  2, nx_rcmd_exec }, 
    3334  { "wait",  2, nx_rcmd_wait }, 
     35  { "end",   1, nx_rcmd_nop }, 
     36  { "nop",   1, nx_rcmd_nop }, 
    3437  { NULL, 0, NULL }, 
    3538}; 
     
    184187  } 
    185188 
    186   if (ntokens == 4 && streq(line + indices[3], "sync") == 0) { 
     189  if (ntokens == 4 && streq(line + indices[3], "sync")) { 
    187190    nx_sound_freq(freq, duration); 
    188191  } else { 
     
    228231 
    229232  nx_systick_wait_ms(wait); 
     233  return RCMD_ERR_NO_ERROR; 
     234} 
     235 
     236static rcmd_err_t nx_rcmd_nop(char *line) { 
     237  /* No-op. */ 
     238  char c; 
     239  c = line[0]; 
     240 
    230241  return RCMD_ERR_NO_ERROR; 
    231242}