Support Callback
This commit is contained in:
parent
d5455189c5
commit
13390bff08
|
@ -155,6 +155,14 @@ namespace JabyEngine {
|
||||||
return __syscall_function_cast(Table_B, ThreadHandle(*)(void(*)(), uint32_t*, uint32_t*))(thread_func, stack_ptr, gp);
|
return __syscall_function_cast(Table_B, ThreadHandle(*)(void(*)(), uint32_t*, uint32_t*))(thread_func, stack_ptr, gp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No return??????
|
||||||
|
static __always_inline void ChangeThread(ThreadHandle handle) {
|
||||||
|
register uint32_t FuncID asm("t1") = 0x10;
|
||||||
|
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));
|
||||||
|
|
||||||
|
__syscall_function_cast(Table_B, void(*)(ThreadHandle))(handle);
|
||||||
|
}
|
||||||
|
|
||||||
static __always_inline void InitPad(uint8_t *portA, uint32_t portASize, uint8_t *portB, uint32_t portBSize) {
|
static __always_inline void InitPad(uint8_t *portA, uint32_t portASize, uint8_t *portB, uint32_t portBSize) {
|
||||||
register uint32_t FuncID asm("t1") = 0x12;
|
register uint32_t FuncID asm("t1") = 0x12;
|
||||||
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));
|
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));
|
||||||
|
|
|
@ -155,8 +155,10 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
void data_ready_handler(uint32_t data) {
|
void data_ready_handler(uint32_t data) {
|
||||||
|
while(true) {
|
||||||
printf("Data: %i\n", data);
|
printf("Data: %i\n", data);
|
||||||
MainThread::restore();
|
SysCall::ChangeThread(0xFF000000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue