fsutils/examples: Include unistd.h explicitly
to get the prototypes or macros are defined in it Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
28d71b79a2
commit
a29d9ea9da
@ -30,6 +30,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
#include "canutils/obd.h"
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
#include "canutils/obd.h"
|
||||
@ -48,8 +50,8 @@
|
||||
* Wait for a message from ECUs with requested PID that was sent using
|
||||
* obd_send_request().
|
||||
*
|
||||
* It will return an error case it doesn't receive the msg after the elapsed
|
||||
* "timeout" time.
|
||||
* It will return an error case it doesn't receive the msg after the
|
||||
* elapsed "timeout" time.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@ -109,10 +111,10 @@ int obd_wait_response(FAR struct obd_dev_s *dev, uint8_t opmode, uint8_t pid,
|
||||
|
||||
/* Check if we received a Response Message */
|
||||
|
||||
if ((extended && dev->can_rxmsg.cm_hdr.ch_id == OBD_PID_EXT_RESPONSE) || \
|
||||
if ((extended &&
|
||||
dev->can_rxmsg.cm_hdr.ch_id == OBD_PID_EXT_RESPONSE) ||
|
||||
(!extended && dev->can_rxmsg.cm_hdr.ch_id == OBD_PID_STD_RESPONSE))
|
||||
{
|
||||
|
||||
/* Check if the Response if for the PID we are interested! */
|
||||
|
||||
if (dev->can_rxmsg.cm_data[1] == (opmode + OBD_RESP_BASE) && \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* apps/examples/hello/abntcodi_main.c
|
||||
* apps/examples/abntcodi/abntcodi_main.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@ -28,6 +28,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <syslog.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "industry/abnt_codi.h"
|
||||
|
||||
@ -45,20 +46,22 @@ void print_abnt_codi(FAR struct abnt_codi_proto_s *proto)
|
||||
proto->end_act_dem);
|
||||
printf("Current Bill Indicator: %d\n", proto->bill_indicator);
|
||||
printf("Reactive Interval Indicator: %d\n", proto->react_interval);
|
||||
printf("Capacitive Reactive Pulses are used to calculate consumption: %s\n",
|
||||
boolstr(proto->react_cap_pulse));
|
||||
printf("Capacitive Reactive Pulses are used to calculate consumption: "
|
||||
"%s\n", boolstr(proto->react_cap_pulse));
|
||||
printf("Inductive Reactive Pulses are used to calculate consumption: %s\n",
|
||||
boolstr(proto->react_ind_pulse));
|
||||
printf("Segment type: %s\n",
|
||||
proto->segment_type == SEGMENT_PEEK ? "PEEK" :
|
||||
proto->segment_type == SEGMENT_OUT_PEEK ? "OUT OF PEEK" :
|
||||
proto->segment_type == SEGMENT_RESERVED ? "RESERVED" : "UNKNOWN");
|
||||
proto->segment_type == SEGMENT_RESERVED ? "RESERVED" :
|
||||
"UNKNOWN");
|
||||
printf("Charges type: %s\n",
|
||||
proto->charge_type == CHARGES_BLUE ? "BLUE" :
|
||||
proto->charge_type == CHARGES_GREEN ? "GREEN" :
|
||||
proto->charge_type == CHARGES_IRRIGATORS ? "IRRIGATORS" : "OTHERS");
|
||||
printf("Number of Active pulses since the beginning of current demand: %d\n",
|
||||
proto->pulses_act_dem);
|
||||
proto->charge_type == CHARGES_IRRIGATORS ? "IRRIGATORS" :
|
||||
"OTHERS");
|
||||
printf("Number of Active pulses since the beginning of current demand: "
|
||||
"%d\n", proto->pulses_act_dem);
|
||||
printf("Number of Reactive pulses since beginning of current demand: %d\n",
|
||||
proto->pulses_react_dem);
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <errno.h>
|
||||
#include <fixedmath.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/input/ajoystick.h>
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/timers/rtc.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/leds/apa102.h>
|
||||
|
||||
@ -59,7 +60,8 @@ struct apa102_ledstrip_s ledstrip[NUM_LEDS];
|
||||
* Converts a color from HSV to RGB.
|
||||
*
|
||||
* Note: This function is based on Pololu example:
|
||||
* https://github.com/pololu/apa102-arduino/blob/master/examples/Rainbow/Rainbow.ino
|
||||
* https://github.com/pololu/apa102-arduino/blob/master/examples/Rainbow/
|
||||
* Rainbow.ino
|
||||
*
|
||||
* Input Parameters:
|
||||
* h is hue, as a number between 0 and 360.
|
||||
@ -79,7 +81,7 @@ static struct apa102_ledstrip_s hsvtorgb(uint16_t h, uint8_t s, uint8_t v)
|
||||
uint8_t g = 0;
|
||||
uint8_t b = 0;
|
||||
|
||||
switch((h / 60) % 6)
|
||||
switch ((h / 60) % 6)
|
||||
{
|
||||
case 0:
|
||||
r = v;
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/apds9960.h>
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/bmi160.h>
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/input/buttons.h>
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/video/video.h>
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <nuttx/input/buttons.h>
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/input/djoystick.h>
|
||||
|
||||
|
@ -23,11 +23,13 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/himem/himem.h>
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/video/fb.h>
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "foc_debug.h"
|
||||
#include "foc_device.h"
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <dspb16.h>
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <dsp.h>
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/lcd/ft80x.h>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* apps/examples/fxos8700cq/fxos8700cq_main.c
|
||||
* apps/examples/fxos8700cq_test/fxos8700cq_main.c
|
||||
* fxos8700cq motion sensor sample application
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -24,8 +24,10 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/fxos8700cq.h>
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/ioexpander/gpio.h>
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <wchar.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "minmea/minmea.h"
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/audio/audio.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/audio/audio.h>
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/leds/userled.h>
|
||||
|
||||
|
@ -46,9 +46,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/lis3dsh.h>
|
||||
|
||||
|
2
examples/lp503x/lp503x_main.c
Executable file → Normal file
2
examples/lp503x/lp503x_main.c
Executable file → Normal file
@ -32,6 +32,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "system/readline.h"
|
||||
|
||||
#include <nuttx/leds/lp503x.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/boardctl.h>
|
||||
|
||||
#include <bootutil/bootutil_public.h>
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/mtd/mtd.h>
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/ioctl.h>
|
||||
#include <nuttx/sensors/mlx90614.h>
|
||||
|
@ -23,7 +23,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "nuttx/sched_note.h"
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/signal.h>
|
||||
#include <nuttx/sensors/dhtxx.h>
|
||||
@ -35,6 +36,7 @@
|
||||
#include <stdio.h>
|
||||
#include <poll.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "nrf24l01_btle.h"
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <errno.h>
|
||||
#include <fixedmath.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/input/nunchuck.h>
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/nx/nx.h>
|
||||
#include <nuttx/nx/nxglib.h>
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "logging/nxscope/nxscope.h"
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/timers/oneshot.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/leds/pca9635pw.h>
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/ltc4151.h>
|
||||
|
||||
|
@ -30,10 +30,12 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_EXAMPLES_MAXSAMPLES
|
||||
@ -87,7 +89,9 @@ int main(int argc, FAR char *argv[])
|
||||
nsamples = CONFIG_EXAMPLES_MAXSAMPLES;
|
||||
}
|
||||
|
||||
/* fill buffer to make it super-clear as to what has and has not been written */
|
||||
/* fill buffer to make it super-clear as to what has and has not been
|
||||
* written
|
||||
*/
|
||||
|
||||
memset(buffer, 0xcc, sizeof(buffer));
|
||||
|
||||
@ -116,15 +120,15 @@ int main(int argc, FAR char *argv[])
|
||||
|
||||
if (nread != nsamples * sizeof(uint32_t))
|
||||
{
|
||||
fprintf(stderr, "ERROR: Read from /dev/random only produced %d bytes\n",
|
||||
(int)nread);
|
||||
fprintf(stderr, "ERROR: Read from /dev/random only produced %zd "
|
||||
"bytes\n", nread);
|
||||
close(fd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Dump the sample buffer */
|
||||
|
||||
lib_dumpbuffer("Random values", (FAR const uint8_t*)buffer, nread);
|
||||
lib_dumpbuffer("Random values", (FAR const uint8_t *)buffer, nread);
|
||||
close(fd);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -23,10 +23,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -63,37 +65,37 @@ int main(int argc, FAR char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
while(1)
|
||||
{
|
||||
red += sred;
|
||||
green += sgreen;
|
||||
blue += sblue;
|
||||
while (1)
|
||||
{
|
||||
red += sred;
|
||||
green += sgreen;
|
||||
blue += sblue;
|
||||
|
||||
if (green == 255)
|
||||
{
|
||||
sred = 0;
|
||||
sgreen = -1;
|
||||
sblue = 1;
|
||||
}
|
||||
if (green == 255)
|
||||
{
|
||||
sred = 0;
|
||||
sgreen = -1;
|
||||
sblue = 1;
|
||||
}
|
||||
|
||||
if (blue == 255)
|
||||
{
|
||||
sred = 1;
|
||||
sgreen = 0;
|
||||
sblue = -1;
|
||||
}
|
||||
if (blue == 255)
|
||||
{
|
||||
sred = 1;
|
||||
sgreen = 0;
|
||||
sblue = -1;
|
||||
}
|
||||
|
||||
if (red == 255)
|
||||
{
|
||||
sred = -1;
|
||||
sblue = 0;
|
||||
sgreen = 1;
|
||||
}
|
||||
if (red == 255)
|
||||
{
|
||||
sred = -1;
|
||||
sblue = 0;
|
||||
sgreen = 1;
|
||||
}
|
||||
|
||||
sprintf(buffer, "#%02X%02X%02X", red, green, blue);
|
||||
write(fd, buffer, 8);
|
||||
usleep(5000);
|
||||
}
|
||||
sprintf(buffer, "#%02X%02X%02X", red, green, blue);
|
||||
write(fd, buffer, 8);
|
||||
usleep(5000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -23,12 +23,13 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/ioctl.h>
|
||||
#include <nuttx/sensors/sht3x.h>
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/lcd/slcd_ioctl.h>
|
||||
#include <nuttx/lcd/slcd_codec.h>
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/timers/timer.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/timers/timer.h>
|
||||
#include <nuttx/ioexpander/gpio.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <poll.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/fs/userfs.h>
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <assert.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <assert.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -34,11 +34,13 @@
|
||||
#include <errno.h>
|
||||
#include <poll.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <nuttx/net/usrsock.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <assert.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -28,8 +28,10 @@
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/clock.h>
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "watched.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/note/noteram_driver.h>
|
||||
#include "task_mn.h"
|
||||
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <debug.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wdt.h"
|
||||
#include "task_mn.h"
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/zerocross.h>
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/fs/fat.h>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* apps/graphics/nuttx/pdcdisp.c
|
||||
* apps/graphics/pdcurs34/nuttx/pdcdisp.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@ -25,6 +25,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TERMCURSES
|
||||
#include <system/termcurses.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* apps/graphics/nuttx/pdcscrn.c
|
||||
* apps/graphics/pdcurs34/nuttx/pdcscrn.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@ -31,6 +31,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <graphics/curses.h>
|
||||
#include "pdcnuttx.h"
|
||||
@ -61,7 +62,8 @@ bool graphic_screen = false;
|
||||
#ifdef CONFIG_SYSTEM_TERMCURSES
|
||||
static void PDC_scr_free_term(FAR SCREEN *sp)
|
||||
{
|
||||
FAR struct pdc_termscreen_s *termscreen = (FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termscreen_s *termscreen =
|
||||
(FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termstate_s *termstate = &termscreen->termstate;
|
||||
|
||||
/* Deinitialize termcurses */
|
||||
@ -145,7 +147,8 @@ static int PDC_scr_open_term(int argc, char **argv)
|
||||
ret = termcurses_getwinsize(termstate->tcurs, &winsz);
|
||||
if (ret != OK)
|
||||
{
|
||||
PDC_LOG(("ERROR: Terminal termcurses driver doesn't support size reporting\n"));
|
||||
PDC_LOG(("ERROR: Terminal termcurses driver doesn't support size "
|
||||
"reporting\n"));
|
||||
free(termscreen);
|
||||
return ERR;
|
||||
}
|
||||
@ -156,8 +159,8 @@ static int PDC_scr_open_term(int argc, char **argv)
|
||||
SP->cols = winsz.ws_col;
|
||||
termscreen->termstate.out_fd = 1;
|
||||
termscreen->termstate.in_fd = 0;
|
||||
termscreen->termstate.fg_red = 0xFFFE;
|
||||
termscreen->termstate.bg_red = 0xFFFE;
|
||||
termscreen->termstate.fg_red = 0xfffe;
|
||||
termscreen->termstate.bg_red = 0xfffe;
|
||||
termstate = &termscreen->termstate;
|
||||
|
||||
/* Setup initial RGB colors */
|
||||
@ -172,7 +175,7 @@ static int PDC_scr_open_term(int argc, char **argv)
|
||||
greylevel += (i & COLOR_BLUE) ? 0x40 : 0;
|
||||
|
||||
termstate->greylevel[i] = greylevel;
|
||||
termstate->greylevel[i+8] = greylevel | 0x3f;
|
||||
termstate->greylevel[i + 8] = greylevel | 0x3f;
|
||||
#else
|
||||
termstate->rgbcolor[i].red = (i & COLOR_RED) ? 0xc0 : 0;
|
||||
termstate->rgbcolor[i].green = (i & COLOR_GREEN) ? 0xc0 : 0;
|
||||
@ -207,18 +210,20 @@ static int PDC_scr_open_term(int argc, char **argv)
|
||||
* Name: PDC_init_pair_term
|
||||
*
|
||||
* Description:
|
||||
* The core of init_pair(). This does all the work of that function, except
|
||||
* checking for values out of range. The values passed to this function
|
||||
* should be returned by a call to PDC_pair_content() with the same pair
|
||||
* number. PDC_transform_line() should use the specified colors when
|
||||
* rendering a chtype with the given pair number.
|
||||
* The core of init_pair(). This does all the work of that function,
|
||||
* except checking for values out of range. The values passed to this
|
||||
* function should be returned by a call to PDC_pair_content() with the
|
||||
* same pair number. PDC_transform_line() should use the specified colors
|
||||
* when rendering a chtype with the given pair number.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TERMCURSES
|
||||
static void PDC_init_pair_term(FAR SCREEN *sp, short pair, short fg, short bg)
|
||||
static void PDC_init_pair_term(FAR SCREEN *sp, short pair,
|
||||
short fg, short bg)
|
||||
{
|
||||
FAR struct pdc_termscreen_s *termscreen = (FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termscreen_s *termscreen =
|
||||
(FAR struct pdc_termscreen_s *)sp;
|
||||
|
||||
termscreen->termstate.colorpair[pair].fg = fg;
|
||||
termscreen->termstate.colorpair[pair].bg = bg;
|
||||
@ -238,7 +243,8 @@ static void PDC_init_pair_term(FAR SCREEN *sp, short pair, short fg, short bg)
|
||||
int PDC_init_color_term(FAR SCREEN *sp, short color, short red, short green,
|
||||
short blue)
|
||||
{
|
||||
FAR struct pdc_termscreen_s *termscreen = (FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termscreen_s *termscreen =
|
||||
(FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termstate_s *termstate;
|
||||
|
||||
DEBUGASSERT(termscreen != NULL);
|
||||
@ -272,7 +278,8 @@ int PDC_init_color_term(FAR SCREEN *sp, short color, short red, short green,
|
||||
int PDC_color_content_term(FAR SCREEN *sp, short color,
|
||||
FAR short *red, FAR short *green, FAR short *blue)
|
||||
{
|
||||
FAR struct pdc_termscreen_s *termscreen = (FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termscreen_s *termscreen =
|
||||
(FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termstate_s *termstate;
|
||||
|
||||
DEBUGASSERT(termscreen != NULL);
|
||||
@ -303,9 +310,11 @@ int PDC_color_content_term(FAR SCREEN *sp, short color,
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TERMCURSES
|
||||
static int PDC_pair_content_term(FAR SCREEN *sp, short pair, short *fg, short *bg)
|
||||
static int PDC_pair_content_term(FAR SCREEN *sp, short pair,
|
||||
FAR short *fg, FAR short *bg)
|
||||
{
|
||||
FAR struct pdc_termscreen_s *termscreen = (FAR struct pdc_termscreen_s *)sp;
|
||||
FAR struct pdc_termscreen_s *termscreen =
|
||||
(FAR struct pdc_termscreen_s *)sp;
|
||||
|
||||
*fg = termscreen->termstate.colorpair[pair].fg;
|
||||
*bg = termscreen->termstate.colorpair[pair].bg;
|
||||
@ -442,7 +451,8 @@ int PDC_scr_open(int argc, char **argv)
|
||||
|
||||
/* Allocate the global instance of SP */
|
||||
|
||||
fbscreen = (FAR struct pdc_fbscreen_s *)zalloc(sizeof(struct pdc_fbscreen_s));
|
||||
fbscreen =
|
||||
(FAR struct pdc_fbscreen_s *)zalloc(sizeof(struct pdc_fbscreen_s));
|
||||
if (fbscreen == NULL)
|
||||
{
|
||||
PDC_LOG(("ERROR: Failed to allocate SP\n"));
|
||||
@ -473,7 +483,7 @@ int PDC_scr_open(int argc, char **argv)
|
||||
greylevel += (i & COLOR_BLUE) ? 0x40 : 0;
|
||||
|
||||
fbstate->greylevel[i] = greylevel;
|
||||
fbstate->greylevel[i+8] = greylevel | 0x3f;
|
||||
fbstate->greylevel[i + 8] = greylevel | 0x3f;
|
||||
#else
|
||||
fbstate->rgbcolor[i].red = (i & COLOR_RED) ? 0xc0 : 0;
|
||||
fbstate->rgbcolor[i].green = (i & COLOR_GREEN) ? 0xc0 : 0;
|
||||
@ -564,8 +574,8 @@ int PDC_scr_open(int argc, char **argv)
|
||||
* address mapping to make the memory accessible to the application.
|
||||
*/
|
||||
|
||||
fbstate->fbmem = mmap(NULL, pinfo.fblen, PROT_READ|PROT_WRITE,
|
||||
MAP_SHARED|MAP_FILE, fbstate->fbfd, 0);
|
||||
fbstate->fbmem = mmap(NULL, pinfo.fblen, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED | MAP_FILE, fbstate->fbfd, 0);
|
||||
if (fbstate->fbmem == MAP_FAILED)
|
||||
{
|
||||
PDC_LOG(("ERROR: ioctl(FBIOGET_PLANEINFO) failed: %d\n", errno));
|
||||
@ -704,9 +714,9 @@ int PDC_resize_screen(int nlines, int ncols)
|
||||
*
|
||||
* Description:
|
||||
* The non-portable functionality of reset_prog_mode() is handled here --
|
||||
* whatever's not done in _restore_mode(). In current ports: In OS/2, this
|
||||
* sets the keyboard to binary mode; in Win32, it enables or disables the
|
||||
* mouse pointer to match the saved mode; in others it does nothing.
|
||||
* whatever's not done in _restore_mode(). In current ports: In OS/2,
|
||||
* this sets the keyboard to binary mode; in Win32, it enables or disables
|
||||
* the mouse pointer to match the saved mode; in others it does nothing.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@ -763,11 +773,11 @@ void PDC_save_screen_mode(int i)
|
||||
* Name: PDC_init_pair
|
||||
*
|
||||
* Description:
|
||||
* The core of init_pair(). This does all the work of that function, except
|
||||
* checking for values out of range. The values passed to this function
|
||||
* should be returned by a call to PDC_pair_content() with the same pair
|
||||
* number. PDC_transform_line() should use the specified colors when
|
||||
* rendering a chtype with the given pair number.
|
||||
* The core of init_pair(). This does all the work of that function,
|
||||
* except checking for values out of range. The values passed to this
|
||||
* function should be returned by a call to PDC_pair_content() with the
|
||||
* same pair number. PDC_transform_line() should use the specified colors
|
||||
* when rendering a chtype with the given pair number.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/hall3ph.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/qencoder.h>
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "industry/foc/foc_log.h"
|
||||
#include "industry/foc/foc_common.h"
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/hall3ph.h>
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/sensors/qencoder.h>
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "industry/foc/foc_log.h"
|
||||
#include "industry/foc/foc_common.h"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <netinet/in.h>
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "iperf.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <signal.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nuttx/net/netconfig.h>
|
||||
#include <nuttx/net/netfilter/ip_tables.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <nuttx/net/ip.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <nuttx/net/ip.h>
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include <poll.h>
|
||||
#include <time.h>
|
||||
#include <debug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <net/if.h>
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "nsh.h"
|
||||
#include "nsh_console.h"
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "nsh.h"
|
||||
#include "nsh_console.h"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user