-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprobes.c
29 lines (27 loc) · 832 Bytes
/
probes.c
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
// SPDX-License-Identifier: 0BSD
/*
* Copyright (C) 2023 Michael T. Kloos <[email protected]>
*/
#include "main.h"
#include "probes.h"
#include "errors.h"
#include <string.h>
typedef void (*ProbesFF)(DAP_Connection* dap_con);
void probes_ff_max32625pico(DAP_Connection* dap_con);
static ProbesFF probe_ff_functions[] = {
probes_ff_max32625pico,
};
static char* probe_names[] = {
"max32625pico",
};
signed int probes_find(DAP_Connection* dap_con, const char* probename) {
size_t array_length = sizeof(probe_names) / sizeof(*probe_names);
for (size_t i = 0; i < array_length; i++) {
if (strcmp(probename, probe_names[i]) == 0) {
ProbesFF probes_ff = probe_ff_functions[i];
probes_ff(dap_con);
return SUCCESS_STATUS;
}
}
return ERROR_NOMATCHDEV;
}