Is it possible to schedule a program to run every 5 ms or 10 ms, etc.? I need to generate a pulse through the serial port for 1 kHz and 15 kHz. But the program should only switch contacts in the serial port, so the frequency must be created by the scheduler. Is this possible in linux with rt patch?
I believe that the best solution is to generate a momentum in a loop, for example:
for (;;) { generate_pulse(); /* generate a pulse */ sleep(5ms); /* or 10ms */ }
is this possible in linux with a rt patch?
I suggest switching to RT patch if the time is critical.
Xenomai is an RT patch that I used on the 2.6 kernel a few days ago.
, 1 . http://www.xenomai.org/documentation/trunk/html/api/trivial-periodic_8c-example.html
PPS, ( , 2.6, 3.x , , ) mainline linux kernel.
PPS txt
PPS ( Carrier Detect) (ACK-pin) CPU GPIO ( ), , , .
-, //, , , .
API- /usr/include/linux/pps.h.
/usr/include/linux/pps.h
- . - . ( ) , . . timer_create() timer_settime() . , fork() execl(). (). , .
Source: https://habr.com/ru/post/1530172/More articles:Change the name of the action bar at the click of a button - androidCreate jmx file with code - automationTextView does not appear at the top of the Google map. - android(Java Swing) How to create a JTextPane with multiple icons on the same line? - javaAndroid: show notifications in viewing mode on any call or social network notification on a mobile device (using Bluetooth) - androidHow to hide outer ring in scalable sunlight - javascriptThird-party applications are locked from writing an SD card from version 4.4.2 Android - androidhow to set width of combobox in java fx - user-interfaceCan someone explain this array declaration in PHP → $ a {0} = "value" - arraysUpload image using AJAX with progress bar - javascriptAll Articles