2 * Copyright © 2012 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 #include <ao_log_micro.h>
24 ao_pos_t ao_log_micro_pos;
27 ao_log_micro_data(uint32_t data)
29 ao_storage_write(ao_log_micro_pos, &data, sizeof (data));
30 ao_log_micro_pos += sizeof (data);
33 uint32_t ao_log_last_ground;
34 uint32_t ao_log_last_done;
37 ao_log_micro_scan(void)
42 ao_storage_read(0, &data, sizeof (data));
43 if ((data & AO_LOG_MICRO_MASK) != AO_LOG_MICRO_GROUND)
46 ao_log_last_ground = data & ~(AO_LOG_MICRO_MASK);
47 for (pos = 4; pos < ao_storage_total; pos += 4) {
48 ao_storage_read(pos, &data, sizeof (data));
49 if ((data & AO_LOG_MICRO_MASK) == AO_LOG_MICRO_GROUND) {
50 ao_log_last_done = data & ~(AO_LOG_MICRO_MASK);
58 ao_log_micro_dump(void)
64 for (pos = 0; pos < ao_storage_total; pos += 4) {
65 ao_storage_read(pos, data, 4);
66 for (i = 0; i < 4; i++)
67 ao_async_byte(data[i]);
68 if (data[3] == (uint8_t) (AO_LOG_MICRO_GROUND >> 24))