main: use header file

This commit is contained in:
King Kévin 2021-07-21 23:39:08 +02:00
parent 1d2be7ceb2
commit 5879b0309e
2 changed files with 7 additions and 3 deletions

8
main.c
View File

@ -4,10 +4,12 @@
*/
#include <stdint.h>
#include <stdbool.h>
#include "stm8s.h"
#include <stdlib.h>
#include "stm8s.h"
#include "main.h"
// get length of array
#define ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
// blocking wait (in 10 us steps, up to UINT32_MAX / 10)
static void wait_10us(uint32_t us10)

2
main.h Normal file
View File

@ -0,0 +1,2 @@
// get length of array
#define ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))