예제 #1
0
static void _prog_loop(void const * argument)
{
	ticks = osKernelSysTick();

	while (1)
	{
		update_common_values();

		io_execute_in();
		program_execute();
		io_execute_out();

		osDelayUntil(&ticks, PROG_LOOP_PERIOD_MS);
	}
}
예제 #2
0
static bool program_memoryarea(HSQUIRRELVM co, const struct reader_handle *h, struct flash_memory_driver *t, bool compare, SQInteger *state, struct textcontrol *log)
{
	if(t->programming.length == 0){
		if(t->programming.offset != 0 && compare == true){
			if(program_compare(h, t) == false){
				log->append(log->object, wgT("%s memory compare failed, offset 0x%06x\n"), t->memory.name, t->programming.offset);
				return false;
			}
		}

		sq_wakeupvm(co, SQFalse, SQFalse, SQTrue, SQFalse);
		*state = sq_getvmstate(co);
	}else{
		program_execute(h, t);
	}
	return true;
}