puts function
This commit is contained in:
parent
b33635641b
commit
720f391a10
|
@ -10,9 +10,13 @@ void __eabi(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//void* ofw_interpret(char* cmd, int32_t* stack_args, int n_stack_args, int n_ret_args, int32_t* reta
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
|
puts("ABCD", 4);
|
||||||
ofw_interpret("blink-screen", 0, 0, 0, 0);
|
ofw_interpret("blink-screen", 0, 0, 0, 0);
|
||||||
|
|
||||||
|
ofw_interpret("key", 0, 0, 1, (int32_t*)0x03020000);
|
||||||
if (ofw_test("open"))
|
if (ofw_test("open"))
|
||||||
{
|
{
|
||||||
asm("mr 27, 28");
|
asm("mr 27, 28");
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include <ofw.h>
|
||||||
|
|
||||||
|
void puts(char* str, int len)
|
||||||
|
{
|
||||||
|
char cmd[len+8];
|
||||||
|
cmd[0] = '.'; cmd[1] = '"';
|
||||||
|
cmd[2] = ' ';
|
||||||
|
for (int i = 3; i < len+3; i++)
|
||||||
|
{
|
||||||
|
cmd[i] = str[i-3];
|
||||||
|
}
|
||||||
|
cmd[len+3] = '"'; cmd[len+4] = ' ';
|
||||||
|
cmd[len+5] = 'c'; cmd[len+6] = 'r';
|
||||||
|
cmd[len+7] = 0;
|
||||||
|
ofw_interpret(cmd, 0, 0, 0, 0);
|
||||||
|
}
|
Loading…
Reference in New Issue