Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
Loading...
Searching...
No Matches
find.c
Go to the documentation of this file.
1/*
2 * Academic License - for use in teaching, academic research, and meeting
3 * course requirements at degree granting institutions only. Not for
4 * government, commercial, or other organizational use.
5 * File: find.c
6 *
7 * MATLAB Coder version : 24.2
8 * C/C++ source code generated on : 03-Dec-2024 17:11:12
9 */
10
11/* Include Files */
12#include "find.h"
13#include "rt_nonfinite.h"
14
15/* Function Definitions */
16/*
17 * Arguments : const boolean_T x[20]
18 * int i_data[]
19 * Return Type : int
20 */
21int b_eml_find(const boolean_T x[5], int i_data[])
22{
23 int i_size;
24 int idx;
25 int ii;
26 boolean_T exitg1;
27 idx = 0;
28 i_size = 1;
29 ii = 5;
30 exitg1 = false;
31 while ((!exitg1) && (ii > 0)) {
32 if (x[ii - 1]) {
33 idx = 1;
34 i_data[0] = ii;
35 exitg1 = true;
36 } else {
37 ii--;
38 }
39 }
40 if (idx == 0) {
41 i_size = 0;
42 }
43 return i_size;
44}
45
46/*
47 * Arguments : const boolean_T x[11]
48 * int i_data[]
49 * Return Type : int
50 */
51int eml_find(const boolean_T x[6], int i_data[])
52{
53 int i_size;
54 int idx;
55 int ii;
56 boolean_T exitg1;
57 idx = 0;
58 i_size = 1;
59 ii = 6;
60 exitg1 = false;
61 while ((!exitg1) && (ii > 0)) {
62 if (x[ii - 1]) {
63 idx = 1;
64 i_data[0] = ii;
65 exitg1 = true;
66 } else {
67 ii--;
68 }
69 }
70 if (idx == 0) {
71 i_size = 0;
72 }
73 return i_size;
74}
75
76/*
77 * File trailer for find.c
78 *
79 * [EOF]
80 */
int b_eml_find(const boolean_T x[5], int i_data[])
Finds the index of the last true element in a 5-element boolean array.
Definition find.c:21
int eml_find(const boolean_T x[6], int i_data[])
Finds the index of the last true element in a 6-element boolean array.
Definition find.c:51
Provides MATLAB Coder helper functions to find indices of true values.
bool boolean_T
Generic boolean type.
Definition rtwtypes.h:89
Provides definitions and utility functions for non-finite floating-point values.