-static void *main_loop(void *targ) {
- struct main_loop_arg *arg = (struct main_loop_arg*)targ;
- struct receiver_arg rarg;
- char *cmd = NULL;
- pthread_t reader_thread;
-
- if (arg->usb_present == 1) {
- rarg.run=1;
- // pthread_create(&reader_thread, NULL, &usb_receiver, &rarg);
- pthread_create(&reader_thread, NULL, &uart_receiver, &rarg);
- }
-
- FILE *script_file = NULL;
- char script_cmd_buf[256];
-
- if (arg->script_cmds_file)
- {
- script_file = fopen(arg->script_cmds_file, "r");
- if (script_file)
- {
- printf("using 'scripting' commands file %s\n", arg->script_cmds_file);
- }
- }
+
+void main_loop(char *script_cmds_file, bool usb_present) {
+ struct receiver_arg rarg;
+ char *cmd = NULL;
+ pthread_t reader_thread;
+
+ if (usb_present) {
+ rarg.run = 1;
+ pthread_create(&reader_thread, NULL, &uart_receiver, &rarg);
+ // cache Version information now:
+ CmdVersion(NULL);
+ }
+
+ FILE *script_file = NULL;
+ char script_cmd_buf[256]; // iceman, needs lua script the same file_path_buffer as the rest
+
+ if (script_cmds_file) {
+ script_file = fopen(script_cmds_file, "r");
+ if (script_file) {
+ printf("using 'scripting' commands file %s\n", script_cmds_file);
+ }
+ }