To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3245
3244  |  3246
Subject: 
LONG DELAY after pressing RUN button (to end the program)
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 27 Apr 2003 02:07:55 GMT
Viewed: 
3002 times
  
Hi there, I see that I'm the only one who has recently used this newsgroup.
Well thanks to the people who has taken the time to answer my questions,
such as nanobapt.

I have another question now. I've two different kernels, legOS 0.2.6 and
brickOS 0.2.6.10 well, when using brickOS I'm experiencing a big delay after
pressing the  RUN button in order to stop the program (the LCD displays
"STOP" for quite a long time). On the other side, when using legOS that does
not happen. The program is quite simple, it's just for testing the lnp
addresing layer.

My question is why is this happening just with brickOS and not with legOS?

Best Regards,
CarlosLuis Rendon M.

#include <conio.h>
#include <unistd.h>
#include <string.h>
#include <lnp.h>
#include <dmotor.h>

#define true 1
#define MY_PORT 2

int go=0;
unsigned char rx[50];

void addressingHandler (const unsigned char *data, unsigned char length,
unsigned char src) {
  go = 1;

}


int main()
{
  int i;
  memset(rx, 0, sizeof(rx));
  i = 0;
  cputs("rec");
  sleep(1);
  cls();
  lnp_addressing_set_handler(MY_PORT,addressingHandler);

  while (true) {
    if (go == 1) {
      cputs ("hello");
      msleep(500);
      cls();
      go = 0;
    }
  }

}



Message has 1 Reply:
  Re: LONG DELAY after pressing RUN button (to end the program)
 
(...) Because stuff was changed in BrickOS. I can't tell you too much, but I'm sure it's trying to shut-down the program in a cleaner way. I think BrickOS waits 2 seconds before killing tasks. You need to change your LegOS loop: while(true) to (...) (21 years ago, 27-Apr-03, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR