forked from microsoft/devicescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjd_impl.c
More file actions
51 lines (38 loc) · 889 Bytes
/
jd_impl.c
File metadata and controls
51 lines (38 loc) · 889 Bytes
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
45
46
47
48
49
50
51
#include "jd_sdk.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include "interfaces/jd_hw.h"
const char app_dev_class_name[] = "jacdac-posix device";
const char app_fw_version[] = "0.0.0";
uint32_t app_get_device_class(void) {
return 0x3fe5b46f;
}
uint32_t now;
void hw_panic(void) {
abort();
}
STATIC_ASSERT(sizeof(char) == 1);
// TODO expose these somehow?
uint8_t jd_connected_blink = JD_BLINK_CONNECTED;
void jd_blink(uint8_t encoded) {}
void jd_glow(uint32_t glow) {}
void jd_alloc_stack_check() {}
void *jd_alloc(uint32_t size) {
void *p = malloc(size);
if (!p)
abort();
memset(p, 0, size);
return p;
}
void jd_free(void *p) {
free(p);
}
void pwr_enter_no_sleep(void) {}
int target_in_irq(void) {
return 0;
}
void target_enable_irq(void) {}
void target_disable_irq(void) {}