Merge pull request #39 from dholm/low-latency/coroutines

Main loop latency reduction with coroutines
This commit is contained in:
sorgelig
2019-01-05 17:41:40 +08:00
committed by GitHub
19 changed files with 1370 additions and 24 deletions

View File

@@ -30,6 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "user_io.h"
#include "input.h"
#include "fpga_io.h"
#include "scheduler.h"
const char *version = "$VER:HPS" VDATE;
@@ -66,26 +67,8 @@ int main(int argc, char *argv[])
FindStorage();
user_io_init((argc > 1) ? argv[1] : "");
while(1)
{
if(!is_fpga_ready(1))
{
printf("FPGA is not ready. JTAG uploading?\n");
printf("Waiting for FPGA to be ready...\n");
scheduler_init();
scheduler_run();
//enable reset in advance
fpga_core_reset(1);
while (!is_fpga_ready(0))
{
sleep(1);
}
reboot(0);
}
user_io_poll();
input_poll(0);
HandleUI();
}
return 0;
}