
Hello!
Chetan Nanda schrieb:
Thanks, for explaining the things, But how can we wait for two events simultaneously (that is also under a single thread of execution)? Can you give me pointer to the code ?
As mentioned before, U-Boot is not an operating system which provides such means. It doesn't have a driver layer with file operations similar to Linux. The only way to wait for events exactly simultaneously is using a hardware which provides these events in one hardware register.
Usually one would poll the event sources:
...
while (1) { if (driver_a_check_data_available()) { driver_a_read_data(); } if (driver_b_check_data_available()) { driver_b_read_data(); } }
if this will be implemented in an U-Boot command, you probably want this loop also to be left, e.g. by pressing Ctrl-C:
while (!ctrlc()) { ... }
Regards Andreas Schweigstill