Merge branch ucsim-034-pre3 to main trunk; new version 0.4
[fw/sdcc] / sim / ucsim / cmd.src / timer.cc
index 7f47b0945e021607d3ffdfc46f4312dcf8b117c7..021b08224e5f8b59fad92be9b142bfe01d40ca1e 100644 (file)
@@ -52,16 +52,16 @@ COMMAND_DO_WORK_UC(cl_timer_cmd)
   if (cmdline->param(0) == 0)
     {
       if (long_help)
-       con->printf("%s\n", long_help);
+       con->dd_printf("%s\n", long_help);
       else
-       con->printf("What to do?\n");
+       con->dd_printf("What to do?\n");
       return(0);
     }
   if ((s= cmdline->param(0)->get_svalue()))
     {
       if (cmdline->param(1) == 0)
        {
-         con->printf("Timer number is missing\n");
+         con->dd_printf("Timer number is missing\n");
          return(0);
        }
       set_ticker(uc, cmdline->param(1));
@@ -80,7 +80,7 @@ COMMAND_DO_WORK_UC(cl_timer_cmd)
       else if (strstr(s, "v") == s)
        return(val(uc, cmdline, con));
       else
-       con->printf("Undefined timer command: \"%s\". Try \"help timer\"\n",
+       con->dd_printf("Undefined timer command: \"%s\". Try \"help timer\"\n",
                    s);
     }
   return(0);
@@ -114,27 +114,27 @@ cl_timer_cmd::add(class cl_uc *uc,
   if (!name &&
       what < 1)
     {
-      con->printf("Error: Timer id must be greater then zero or a string\n");
+      con->dd_printf("Error: Timer id must be greater then zero or a string\n");
       return(DD_FALSE);
     }
   if (ticker)
     {
       if (name)
-       con->printf("Error: Timer \"%s\" already exists\n", name);
+       con->dd_printf("Error: Timer \"%s\" already exists\n", name);
       else
-       con->printf("Error: Timer %d already exists\n", what);
+       con->dd_printf("Error: Timer %d already exists\n", what);
       return(0);
     }
   if (params[2])
     if (!params[2]->get_ivalue(&dir))
       {
-       con->printf("Error: Wrong direction\n");
+       con->dd_printf("Error: Wrong direction\n");
        return(DD_FALSE);
       }
   if (params[3])
     if (!params[3]->get_ivalue(&in_isr))
       {
-       con->printf("Error: Wrong parameter\n");
+       con->dd_printf("Error: Wrong parameter\n");
        return(DD_FALSE);
       }
 
@@ -163,9 +163,9 @@ cl_timer_cmd::del(class cl_uc *uc,
   if (!ticker)
     {
       if (name)
-       con->printf("Timer \"%s\" does not exist\n", name);
+       con->dd_printf("Timer \"%s\" does not exist\n", name);
       else
-       con->printf("Timer %d does not exist\n", what);
+       con->dd_printf("Timer %d does not exist\n", what);
       return(0);
     }
   if (name)
@@ -213,9 +213,9 @@ cl_timer_cmd::run(class cl_uc *uc,
   if (!ticker)
     {
       if (name)
-       con->printf("Timer %d does not exist\n", name);
+       con->dd_printf("Timer %d does not exist\n", name);
       else
-       con->printf("Timer %d does not exist\n", what);
+       con->dd_printf("Timer %d does not exist\n", what);
       return(0);
     }
   ticker->options|= TICK_RUN;
@@ -234,9 +234,9 @@ cl_timer_cmd::stop(class cl_uc *uc,
   if (!ticker)
     {
       if (name)
-       con->printf("Timer %d does not exist\n", name);
+       con->dd_printf("Timer %d does not exist\n", name);
       else
-       con->printf("Timer %d does not exist\n", what);
+       con->dd_printf("Timer %d does not exist\n", what);
       return(0);
     }
   ticker->options&= ~TICK_RUN;
@@ -261,20 +261,20 @@ cl_timer_cmd::val(class cl_uc *uc,
   if (!ticker)
     {
       if (name)
-       con->printf("Error: Timer %d does not exist\n", name);
+       con->dd_printf("Error: Timer %d does not exist\n", name);
       else
-       con->printf("Error: Timer %d does not exist\n", what);
+       con->dd_printf("Error: Timer %d does not exist\n", what);
       return(0);
     }
   if (params[2])
     {
-      con->printf("Error: Value is missing\n");
+      con->dd_printf("Error: Value is missing\n");
       return(DD_FALSE);
     }
   long val;
   if (!params[2]->get_ivalue(&val))
     {
-      con->printf("Error: Wrong parameter\n");
+      con->dd_printf("Error: Wrong parameter\n");
       return(DD_FALSE);
     }
   ticker->ticks= val;