def START(): RX_FIFO_init() TX_FIFO_init() USER_BRIDGE.RUN_INIT() global USER_STATUS global TXD_STATUS global MEM_USER_STATUS global USER_LOOP USER_LOOP = 1 USER_STATUS = 1 TXD_STATUS = 1 MEM_USER_STATUS = 1 #------------------------------- time.sleep(0.2) global txdEvent txdEvent = threading.Event() _TXD_Thread = TXD_Thread(1, "TXD_Thread") _TXD_Thread.start() #------------------------------- time.sleep(0.2) global userEvent userEvent = threading.Event() _userThread = userThread(1, "userThread") _userThread.start() #------------------------------- time.sleep(0.2) global mem_userEvent mem_userEvent = threading.Event() _mem_userThread = mem_userThread(1, "mem_userThread") _mem_userThread.start() #------------------------------- time.sleep(0.2) _loop_userThread = loop_userThread(1, "mem_userThread") _loop_userThread.start()
def run(self): if (MED_dbg == 1): print "###################################" if (MED_dbg == 1): print "... MED : ... : USER LOOP !!!" if (MED_dbg == 1): print "###################################" global USER_LOOP while 1: if (USER_LOOP == 0): break USER_BRIDGE.RUN_LOOP() if (USER_LOOP == 0): break if (MED_dbg == 1): print "###################################" if (MED_dbg == 1): print "... MED : ... : USER LOOP !!!" if (MED_dbg == 1): print "###################################" USER_LOOP = 0
def run(self): if (MED_dbg == 1): print "###################################" if (MED_dbg == 1): print "... MED : MEM : USER START !!!" if (MED_dbg == 1): print "###################################" global MEM_USER_STATUS while 1: global mem_user_event_is_set if (MED_dbg == 1): print "... MED : MEM : EVENT : wait" mem_user_event_is_set = mem_userEvent.wait(3) if (MEM_USER_STATUS == 0): break if mem_user_event_is_set: if (MED_dbg == 1): print "... MED : MEM : EVENT : detected !!!" mem_userEvent.clear() while (RX_FIFO_Len()): (s, d) = RX_FIFO_Get() USER_BRIDGE.RUN_MEM_DATA_PROCESSING(s, d) else: if (MEM_USER_STATUS == 0): break if (MED_dbg == 1): print "###################################" if (MED_dbg == 1): print "... MED : MEM : USER STOP !!!" if (MED_dbg == 1): print "###################################" MEM_USER_STATUS = 0
def run(self): if (MED_dbg == 1): print "###################################" if (MED_dbg == 1): print "... MED : ... : USER START !!!" if (MED_dbg == 1): print "###################################" global USER_STATUS while 1: global user_event_is_set if (MED_dbg == 1): print "... MED : ... : EVENT : wait" user_event_is_set = userEvent.wait(3) if (USER_STATUS == 0): break if user_event_is_set: if (MED_dbg == 1): print "... MED : ... : EVENT : detected !!!" userEvent.clear() while (RX_FIFO_Len()): d = RX_FIFO_Get() USER_BRIDGE.RUN_DATA_PROCESSING(d) else: if (USER_STATUS == 0): break if (MED_dbg == 1): print "###################################" if (MED_dbg == 1): print "... MED : ... : USER STOP !!!" if (MED_dbg == 1): print "###################################" USER_STATUS = 0