comparison frbl/reconst/serial.c @ 328:0029db632547

frbl/reconst/serial.c: first static function reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 06 Mar 2020 07:08:58 +0000
parents
children 63d3afd14523
comparison
equal deleted inserted replaced
327:b5b8df53aa51 328:0029db632547
1 #include "main/sys_types.h"
2 #include "serial.h"
3 #include "convert.h"
4
5 static const SYS_UWORD32 S0_expect[7] = {6, 0, 0, 'H', 'D', 'R', 0x1B};
6 static const SYS_UWORD32 S7_expect[6] = {5, 0, 0, 0, 0, 0xFA};
7
8 static const SYS_UWORD32 uart_base[2] = {0xFFFF5800, 0xFFFF5000};
9
10 static SYS_UWORD32 bss_0;
11 static SYS_UWORD8 bss_4;
12 static SYS_UWORD8 bss_5;
13 static SYS_UWORD8 bss_6;
14 static SYS_UWORD8 bss_7;
15 static SYS_UWORD8 bss_8;
16 static SYS_UWORD32 bss_0xc;
17 static SYS_UWORD8 bss_0x10;
18 static SYS_UWORD16 bss_0x12;
19
20 static SYS_UWORD32
21 static_func_0x0(SYS_UWORD8 arg1, SYS_UWORD32 *arg2, SYS_UWORD32 *arg3,
22 SYS_UWORD16 *arg4)
23 {
24 SYS_UWORD32 retval;
25
26 bss_5 += arg1;
27 if (bss_6) {
28 bss_0x12 += arg1;
29 *arg4 = bss_0x12;
30 *arg2 = 0;
31 retval = 0;
32 } else {
33 *arg3 += 2;
34 bss_0x12 = arg1 << 8;
35 retval = 1;
36 }
37 bss_6 = ~bss_6 & 1;
38 bss_0x10--;
39 if (bss_0x10 == 0)
40 bss_0xc = 6;
41 return retval;
42 }