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:
Xiang Xiao 2023-02-04 21:56:06 +08:00 committed by Petro Karashchenko
parent 28d71b79a2
commit a29d9ea9da
153 changed files with 269 additions and 84 deletions

View File

@ -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"

View File

@ -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) && \

View File

@ -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);
}

View File

@ -32,6 +32,7 @@
#include <errno.h>
#include <fixedmath.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/input/ajoystick.h>

View File

@ -32,6 +32,7 @@
#include <fcntl.h>
#include <sched.h>
#include <errno.h>
#include <unistd.h>
#include <nuttx/timers/rtc.h>

View File

@ -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;

View File

@ -28,6 +28,7 @@
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <nuttx/sensors/apds9960.h>

View File

@ -26,6 +26,7 @@
#include <inttypes.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <nuttx/sensors/bmi160.h>

View File

@ -28,6 +28,7 @@
#include <sched.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <net/if.h>
#include <arpa/inet.h>

View File

@ -33,6 +33,7 @@
#include <fcntl.h>
#include <sched.h>
#include <errno.h>
#include <unistd.h>
#include <nuttx/input/buttons.h>

View File

@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <unistd.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -32,6 +32,7 @@
#include <sys/time.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include <nuttx/video/video.h>

View File

@ -34,6 +34,7 @@
#include <fcntl.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/can/can.h>

View File

@ -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>

View File

@ -31,6 +31,7 @@
#include <fcntl.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/input/djoystick.h>

View File

@ -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>

View File

@ -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>

View File

@ -27,6 +27,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <assert.h>
#include <unistd.h>
#include "foc_debug.h"
#include "foc_device.h"

View File

@ -27,6 +27,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <assert.h>
#include <unistd.h>
#include <dspb16.h>

View File

@ -27,6 +27,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <assert.h>
#include <unistd.h>
#include <dsp.h>

View File

@ -28,6 +28,7 @@
#include <fcntl.h>
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include <sys/ioctl.h>

View File

@ -30,6 +30,7 @@
#include <nuttx/config.h>
#include <errno.h>
#include <unistd.h>
#include <nuttx/lcd/ft80x.h>

View File

@ -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>

View File

@ -32,6 +32,7 @@
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <nuttx/ioexpander/gpio.h>

View File

@ -28,6 +28,7 @@
#include <fcntl.h>
#include <wchar.h>
#include <syslog.h>
#include <unistd.h>
#include "minmea/minmea.h"

View File

@ -31,6 +31,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -30,6 +30,7 @@
#include <pthread.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/audio/audio.h>

View File

@ -30,6 +30,7 @@
#include <pthread.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/audio/audio.h>

View File

@ -34,6 +34,7 @@
#include <string.h>
#include <assert.h>
#include <signal.h>
#include <unistd.h>
/****************************************************************************
* Private Data

View File

@ -29,6 +29,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <debug.h>
#include <unistd.h>
#include <arpa/inet.h>

View File

@ -31,6 +31,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -32,6 +32,7 @@
#include <sched.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <nuttx/leds/userled.h>

View File

@ -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
View 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>

View File

@ -32,6 +32,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <poll.h>
#include <unistd.h>
/****************************************************************************
* Public Functions

View File

@ -29,6 +29,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
/****************************************************************************
* Public Functions

View File

@ -26,6 +26,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/boardctl.h>
#include <bootutil/bootutil_public.h>

View File

@ -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>

View File

@ -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>

View File

@ -23,7 +23,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <unistd.h>
#include "nuttx/sched_note.h"

View File

@ -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"

View File

@ -28,7 +28,6 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdbool.h>

View File

@ -32,6 +32,7 @@
#include <errno.h>
#include <fixedmath.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/input/nunchuck.h>

View File

@ -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>

View File

@ -27,6 +27,7 @@
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include "logging/nxscope/nxscope.h"

View File

@ -32,6 +32,7 @@
#include <fcntl.h>
#include <time.h>
#include <errno.h>
#include <unistd.h>
#include <nuttx/timers/oneshot.h>

View File

@ -30,6 +30,7 @@
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <nuttx/leds/pca9635pw.h>

View File

@ -34,6 +34,7 @@
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <nuttx/sensors/ltc4151.h>

View File

@ -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;
}

View File

@ -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;
}

View File

@ -30,6 +30,8 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <nuttx/arch.h>
/****************************************************************************

View File

@ -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>

View File

@ -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>

View File

@ -31,6 +31,7 @@
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
/****************************************************************************
* Private Data

View File

@ -28,7 +28,6 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>

View File

@ -31,6 +31,8 @@
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <nuttx/timers/timer.h>
/****************************************************************************

View File

@ -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>

View File

@ -30,6 +30,7 @@
#include <poll.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <net/if.h>
#include <arpa/inet.h>

View File

@ -30,6 +30,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <nuttx/fs/userfs.h>

View File

@ -29,6 +29,7 @@
#include <assert.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include "defines.h"

View File

@ -30,6 +30,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include "defines.h"

View File

@ -27,6 +27,7 @@
#include <sys/types.h>
#include <stdbool.h>
#include <assert.h>
#include <unistd.h>
#include "defines.h"

View File

@ -30,6 +30,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include "defines.h"

View File

@ -29,6 +29,7 @@
#include <assert.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include "defines.h"

View File

@ -31,6 +31,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <unistd.h>
#include "defines.h"

View File

@ -32,6 +32,7 @@
#include <arpa/inet.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include "defines.h"

View File

@ -24,6 +24,7 @@
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include "defines.h"

View File

@ -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"

View File

@ -26,6 +26,7 @@
#include <assert.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include "defines.h"

View File

@ -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"

View File

@ -28,6 +28,7 @@
#include <stdbool.h>
#include <assert.h>
#include <fcntl.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>

View File

@ -31,6 +31,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include "defines.h"

View File

@ -24,6 +24,7 @@
#include <sys/socket.h>
#include <errno.h>
#include <unistd.h>
#include "defines.h"

View File

@ -32,6 +32,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include "defines.h"

View File

@ -32,6 +32,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include "defines.h"

View File

@ -28,6 +28,7 @@
#include <arpa/inet.h>
#include <errno.h>
#include <poll.h>
#include <unistd.h>
#include <nuttx/clock.h>

View File

@ -26,6 +26,8 @@
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include "watched.h"
/****************************************************************************

View File

@ -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"

View File

@ -32,6 +32,8 @@
#include <fcntl.h>
#include <debug.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "wdt.h"
#include "task_mn.h"

View File

@ -31,6 +31,7 @@
#include <fcntl.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/sensors/zerocross.h>

View File

@ -31,6 +31,7 @@
#include <string.h>
#include <debug.h>
#include <errno.h>
#include <unistd.h>
#include <nuttx/fs/fs.h>

View File

@ -30,6 +30,7 @@
#include <string.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <nuttx/fs/fat.h>

View File

@ -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>

View File

@ -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.
*
****************************************************************************/

View File

@ -30,6 +30,7 @@
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <nuttx/sensors/hall3ph.h>

View File

@ -30,6 +30,7 @@
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <nuttx/sensors/qencoder.h>

View File

@ -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"

View File

@ -30,6 +30,7 @@
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <nuttx/sensors/hall3ph.h>

View File

@ -30,6 +30,7 @@
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <nuttx/sensors/qencoder.h>

View File

@ -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"

View File

@ -38,6 +38,7 @@
#include <assert.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <netdb.h>
#include <arpa/inet.h>

View File

@ -30,6 +30,8 @@
#include <netinet/in.h>
#include <assert.h>
#include <stdbool.h>
#include <unistd.h>
#include "iperf.h"
/****************************************************************************

View File

@ -42,6 +42,7 @@
#include <signal.h>
#include <assert.h>
#include <debug.h>
#include <unistd.h>
#include <net/if.h>
#include <arpa/inet.h>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -38,6 +38,7 @@
#include <assert.h>
#include <errno.h>
#include <debug.h>
#include <unistd.h>
#include <netinet/in.h>

View File

@ -52,6 +52,7 @@
#include <poll.h>
#include <time.h>
#include <debug.h>
#include <unistd.h>
#include <netinet/in.h>
#include <net/if.h>

View File

@ -31,6 +31,7 @@
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "nsh.h"
#include "nsh_console.h"

View File

@ -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