blob: 167f696970e713bda4b8adda849b36a14e62be5c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
coreutil.h
Miscellaneous utility code
***************************************************************************/
#pragma once
#ifndef __COREUTIL_H__
#define __COREUTIL_H__
#include "osdcomm.h"
/***************************************************************************
BINARY CODED DECIMAL HELPERS
***************************************************************************/
int bcd_adjust(int value);
uint32_t dec_2_bcd(uint32_t a);
uint32_t bcd_2_dec(uint32_t a);
/***************************************************************************
GREGORIAN CALENDAR HELPERS
***************************************************************************/
int gregorian_is_leap_year(int year);
int gregorian_days_in_month(int month, int year);
/***************************************************************************
MISC
***************************************************************************/
void rand_memory(void *memory, size_t length);
uint32_t core_crc32(uint32_t crc, const uint8_t *buf, uint32_t len);
#endif /* __COREUTIL_H__ */
|