diff --git a/drivers/lcd/ft80x.c b/drivers/lcd/ft80x.c index 3397c7d2fe..dbc58d322b 100644 --- a/drivers/lcd/ft80x.c +++ b/drivers/lcd/ft80x.c @@ -682,6 +682,31 @@ static int ft80x_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } break; + /* FT80X_IOC_PUTRAMCMD + * Description: Write 32-bit aligned data to FT80x FIFO (RAM_CMD) + * Argument: A reference to an instance of struct ft80x_relmem_s below. + * Returns: None. + */ + + case FT80X_IOC_PUTRAMCMD: + { + FAR struct ft80x_relmem_s *ramcmd = + (FAR struct ft80x_relmem_s *)((uintptr_t)arg); + + if (ramcmd == NULL || ((uintptr_t)&ramcmd->offset & 3) != 0 /* || + ramcmd->offset >= FT80X_CMDFIFO_SIZE */ ) + { + ret = -EINVAL; + } + else + { + ft80x_write_memory(priv, FT80X_RAM_CMD + ramcmd->offset, + ramcmd->value, ramcmd->nbytes); + ret = OK; + } + } + break; + /* FT80X_IOC_GETREG8: * Description: Read an 8-bit register value from the FT80x. * Argument: A reference to an instance of struct ft80x_register_s. diff --git a/include/nuttx/lcd/ft80x.h b/include/nuttx/lcd/ft80x.h index 7251ff1b10..c8a33bf4aa 100644 --- a/include/nuttx/lcd/ft80x.h +++ b/include/nuttx/lcd/ft80x.h @@ -127,7 +127,7 @@ * either case but must be subsequently obtained using FT80X_IOC_GETRAMDL. * * FT80X_IOC_GETRAMDL: - * Description: Read a 32-bit value from the display list. + * Description: Read a 32-bit aligned data from the display list. * Argument: A reference to an instance of struct ft80x_relmem_s below. * Returns: The 32-bit value read from the display list. * @@ -136,6 +136,11 @@ * Argument: A reference to an instance of struct ft80x_relmem_s below. * Returns: None. * + * FT80X_IOC_PUTRAMCMD + * Description: Write 32-bit aligned data to FT80x FIFO (RAM_CMD) + * Argument: A reference to an instance of struct ft80x_relmem_s below. + * Returns: None. + * * FT80X_IOC_GETREG8: * Description: Read an 8-bit register value from the FT80x. * Argument: A reference to an instance of struct ft80x_register_s below. @@ -182,13 +187,14 @@ #define FT80X_IOC_APPENDDL _LCDIOC(FT80X_NIOCTL_BASE + 1) #define FT80X_IOC_GETRAMDL _LCDIOC(FT80X_NIOCTL_BASE + 2) #define FT80X_IOC_PUTRAMG _LCDIOC(FT80X_NIOCTL_BASE + 3) -#define FT80X_IOC_GETREG8 _LCDIOC(FT80X_NIOCTL_BASE + 4) -#define FT80X_IOC_GETREG16 _LCDIOC(FT80X_NIOCTL_BASE + 5) -#define FT80X_IOC_GETREG32 _LCDIOC(FT80X_NIOCTL_BASE + 6) -#define FT80X_IOC_PUTREG8 _LCDIOC(FT80X_NIOCTL_BASE + 7) -#define FT80X_IOC_PUTREG16 _LCDIOC(FT80X_NIOCTL_BASE + 8) -#define FT80X_IOC_PUTREG32 _LCDIOC(FT80X_NIOCTL_BASE + 9) -#define FT80X_IOC_EVENTNOTIFY _LCDIOC(FT80X_NIOCTL_BASE + 10) +#define FT80X_IOC_PUTRAMCMD _LCDIOC(FT80X_NIOCTL_BASE + 4) +#define FT80X_IOC_GETREG8 _LCDIOC(FT80X_NIOCTL_BASE + 5) +#define FT80X_IOC_GETREG16 _LCDIOC(FT80X_NIOCTL_BASE + 6) +#define FT80X_IOC_GETREG32 _LCDIOC(FT80X_NIOCTL_BASE + 7) +#define FT80X_IOC_PUTREG8 _LCDIOC(FT80X_NIOCTL_BASE + 8) +#define FT80X_IOC_PUTREG16 _LCDIOC(FT80X_NIOCTL_BASE + 9) +#define FT80X_IOC_PUTREG32 _LCDIOC(FT80X_NIOCTL_BASE + 10) +#define FT80X_IOC_EVENTNOTIFY _LCDIOC(FT80X_NIOCTL_BASE + 11) /* FT80x Memory Map *************************************************************************/ @@ -1353,8 +1359,8 @@ struct ft80x_displaylist_s struct ft80x_dlcmd_s cmd; /* First command in the display list */ }; -/* This structure is used with the FT80X_IOC_GETRAMDL and FT80X_IOC_PUTRAMG IOCTL commands to - * access particular memory regions via an offset. +/* This structure is used with the FT80X_IOC_GETRAMDL, FT80X_IOC_PUTRAMG, and + * FT80X_IOC_PUTRAMCMD IOCTL commands to access particular memory regions via an offset. * * NOTES: * - For FT80X_IOC_GET* commands, the value is an output; for FT80X_IOC_PUT* command, the diff --git a/include/nuttx/lcd/lcd_ioctl.h b/include/nuttx/lcd/lcd_ioctl.h index 7c6737d11b..7fd9301fd5 100644 --- a/include/nuttx/lcd/lcd_ioctl.h +++ b/include/nuttx/lcd/lcd_ioctl.h @@ -50,7 +50,7 @@ /* IOCTL commands set aside for FT80x character driver */ -#define FT80X_NIOCTL_CMDS 11 +#define FT80X_NIOCTL_CMDS 12 #define FT80X_NIOCTL_BASE 0x0001 #endif /* __INCLUDE_NUTTX_INPUT_LCD_IOCTL_H */ diff --git a/sched/signal/sig_procmask.c b/sched/signal/sig_procmask.c index 27f1d77102..166ba456df 100644 --- a/sched/signal/sig_procmask.c +++ b/sched/signal/sig_procmask.c @@ -113,7 +113,7 @@ int nxsig_procmask(int how, FAR const sigset_t *set, FAR sigset_t *oset) /* Return the old signal mask if requested */ oldsigprocmask = rtcb->sigprocmask; - if (oset) + if (oset != NULL) { *oset = oldsigprocmask; }