Browse Source

Rename lots of files to help prevent compile time name conflicts.

remotes/origin_old/ugfx_release_2.6
inmarket 8 years ago
parent
commit
0f3f8f68f8
  1. 2
      demos/modules/gadc/gwinosc.c
  2. 2
      demos/modules/gaudio/oscilloscope/gwinosc.c
  3. 2
      drivers/gaudio/vs1053/driver.mk
  4. 4
      src/gadc/gadc_gadc.c
  5. 2
      src/gadc/sys_make.mk
  6. 6
      src/gaudio/gaudio_gaudio.c
  7. 2
      src/gaudio/sys_make.mk
  8. 2
      src/gdisp/fonts/build_fonts.sh
  9. 34
      src/gdisp/fonts/fonts.h
  10. 2
      src/gdisp/gdisp_colors.h
  11. 4
      src/gdisp/gdisp_fonts.c
  12. 6
      src/gdisp/gdisp_gdisp.c
  13. 2
      src/gdisp/gdisp_image.c
  14. 2
      src/gdisp/gdisp_image.h
  15. 0
      src/gdisp/gdisp_image_bmp.c
  16. 0
      src/gdisp/gdisp_image_gif.c
  17. 0
      src/gdisp/gdisp_image_jpg.c
  18. 0
      src/gdisp/gdisp_image_native.c
  19. 0
      src/gdisp/gdisp_image_png.c
  20. 4
      src/gdisp/sys_defs.h
  21. 16
      src/gdisp/sys_make.mk
  22. 2
      src/gevent/gevent_gevent.c
  23. 2
      src/gevent/sys_make.mk
  24. 8
      src/gfile/gfile_fatfs_diskio_chibios.c
  25. 4
      src/gfile/gfile_fatfs_wrapper.c
  26. 2
      src/gfile/gfile_fatfs_wrapper.h
  27. 0
      src/gfile/gfile_fs_chibios.c
  28. 0
      src/gfile/gfile_fs_fatfs.c
  29. 0
      src/gfile/gfile_fs_mem.c
  30. 1
      src/gfile/gfile_fs_native.c
  31. 0
      src/gfile/gfile_fs_petitfs.c
  32. 0
      src/gfile/gfile_fs_ram.c
  33. 0
      src/gfile/gfile_fs_rom.c
  34. 0
      src/gfile/gfile_fs_strings.c
  35. 2
      src/gfile/gfile_gfile.c
  36. 8
      src/gfile/gfile_petitfs_diskio_chibios.c
  37. 4
      src/gfile/gfile_petitfs_wrapper.c
  38. 2
      src/gfile/gfile_petitfs_wrapper.h
  39. 0
      src/gfile/gfile_printg.c
  40. 0
      src/gfile/gfile_scang.c
  41. 0
      src/gfile/gfile_stdio.c
  42. 32
      src/gfile/sys_make.mk
  43. 4
      src/ginput/ginput_dial.c
  44. 2
      src/ginput/ginput_dial.h
  45. 2
      src/ginput/ginput_ginput.c
  46. 46
      src/ginput/ginput_keyboard.c
  47. 2
      src/ginput/ginput_keyboard.h
  48. 4
      src/ginput/ginput_mouse.c
  49. 2
      src/ginput/ginput_mouse.h
  50. 312
      src/ginput/ginput_toggle.c
  51. 2
      src/ginput/ginput_toggle.h
  52. 8
      src/ginput/sys_defs.h
  53. 10
      src/ginput/sys_make.mk
  54. 452
      src/gmisc/gmisc_arrayops.c
  55. 2
      src/gmisc/gmisc_gmisc.c
  56. 2
      src/gmisc/gmisc_trig.c
  57. 6
      src/gmisc/sys_make.mk
  58. 2
      src/gqueue/gqueue_gqueue.c
  59. 2
      src/gqueue/sys_make.mk
  60. 476
      src/gtimer/gtimer_gtimer.c
  61. 2
      src/gtimer/sys_make.mk
  62. 4
      src/gwin/gwin_button.c
  63. 4
      src/gwin/gwin_button.h
  64. 4
      src/gwin/gwin_checkbox.c
  65. 4
      src/gwin/gwin_checkbox.h
  66. 4
      src/gwin/gwin_class.h
  67. 4
      src/gwin/gwin_console.c
  68. 4
      src/gwin/gwin_console.h
  69. 4
      src/gwin/gwin_container.c
  70. 6
      src/gwin/gwin_container.h
  71. 4
      src/gwin/gwin_frame.c
  72. 4
      src/gwin/gwin_frame.h
  73. 2
      src/gwin/gwin_gl3d.c
  74. 2
      src/gwin/gwin_gl3d.h
  75. 4
      src/gwin/gwin_graph.c
  76. 4
      src/gwin/gwin_graph.h
  77. 7
      src/gwin/gwin_gwin.c
  78. 4
      src/gwin/gwin_image.c
  79. 4
      src/gwin/gwin_image.h
  80. 4
      src/gwin/gwin_label.c
  81. 4
      src/gwin/gwin_label.h
  82. 4
      src/gwin/gwin_list.c
  83. 4
      src/gwin/gwin_list.h
  84. 4
      src/gwin/gwin_progressbar.c
  85. 3
      src/gwin/gwin_progressbar.h
  86. 4
      src/gwin/gwin_radio.c
  87. 4
      src/gwin/gwin_radio.h
  88. 4
      src/gwin/gwin_slider.c
  89. 4
      src/gwin/gwin_slider.h
  90. 7
      src/gwin/gwin_widget.c
  91. 18
      src/gwin/gwin_widget.h
  92. 9
      src/gwin/gwin_wm.c
  93. 12
      src/gwin/sys_defs.h
  94. 30
      src/gwin/sys_make.mk

2
demos/modules/gadc/gwinosc.c

@ -36,7 +36,7 @@
#include "gwinosc.h"
/* Include internal GWIN routines so we can build our own superset class */
#include "src/gwin/class_gwin.h"
#include "src/gwin/gwin_class.h"
/* How many flat-line sample before we trigger */
#define FLATLINE_SAMPLES 8

2
demos/modules/gaudio/oscilloscope/gwinosc.c

@ -43,7 +43,7 @@
#include "gwinosc.h"
/* Include internal GWIN routines so we can build our own superset class */
#include "src/gwin/class_gwin.h"
#include "src/gwin/gwin_class.h"
/* How many flat-line sample before we trigger */
#define FLATLINE_SAMPLES 8

2
drivers/gaudio/vs1053/driver.mk

@ -4,4 +4,4 @@ GFXSRC += $(GFXLIB)/drivers/gaudio/vs1053/gaudio_play_lld.c
# Required include directories
GFXINC += $(GFXLIB)/drivers/gaudio/vs1053
GFXDEFS += -DGFX_USE_GTIMER=GFX_USE_GAUDIO
#GFXDEFS += -DGFX_USE_GTIMER=GFX_USE_GAUDIO

4
src/gadc/gadc.c → src/gadc/gadc_gadc.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gadc/gadc.c
* @file src/gadc/gadc_gadc.c
* @brief GADC sub-system code.
*
* @addtogroup GADC
@ -17,7 +17,7 @@
#if GFX_USE_GADC
/* Include the driver defines */
#include "src/gadc/driver.h"
#include "driver.h"
#if GADC_MAX_HIGH_SPEED_SAMPLERATE > GADC_MAX_SAMPLE_FREQUENCY/2
#error "GADC: GADC_MAX_HIGH_SPEED_SAMPLERATE has been set too high. It must be less than half the maximum CPU rate"

2
src/gadc/sys_make.mk

@ -1 +1 @@
GFXSRC += $(GFXLIB)/src/gadc/gadc.c
GFXSRC += $(GFXLIB)/src/gadc/gadc_gadc.c

6
src/gaudio/gaudio.c → src/gaudio/gaudio_gaudio.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gaudio/gaudio.c
* @file src/gaudio/gaudio_gaudio.c
* @brief GAUDIO sub-system code.
*
* @addtogroup GAUDIO
@ -17,7 +17,7 @@
#if GFX_USE_GAUDIO
#if GAUDIO_NEED_PLAY
#include "src/gaudio/driver_play.h"
#include "driver_play.h"
static gfxQueueASync playList;
static gfxSem playComplete;
@ -32,7 +32,7 @@
#endif
#if GAUDIO_NEED_RECORD
#include "src/gaudio/driver_record.h"
#include "driver_record.h"
static gfxQueueGSync recordList;
static uint16_t recordFlags;

2
src/gaudio/sys_make.mk

@ -1 +1 @@
GFXSRC += $(GFXLIB)/src/gaudio/gaudio.c
GFXSRC += $(GFXLIB)/src/gaudio/gaudio_gaudio.c

2
src/gdisp/fonts/build_fonts.sh

@ -72,7 +72,7 @@ for file in *.c; do
defname='GDISP_INCLUDE_FONT_'$upper
echo '#if defined('$defname') && '$defname >> fonts.h
echo '#define GDISP_FONT_FOUND' >> fonts.h
echo '#include "src/gdisp/fonts/'$file'"' >> fonts.h
echo '#include "'$file'"' >> fonts.h
echo '#endif' >> fonts.h
done

34
src/gdisp/fonts/fonts.h

@ -3,87 +3,87 @@
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS10) && GDISP_INCLUDE_FONT_DEJAVUSANS10
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans10.c"
#include "DejaVuSans10.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS12_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS12_AA
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans12_aa.c"
#include "DejaVuSans12_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS12) && GDISP_INCLUDE_FONT_DEJAVUSANS12
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans12.c"
#include "DejaVuSans12.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS16_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS16_AA
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans16_aa.c"
#include "DejaVuSans16_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS16) && GDISP_INCLUDE_FONT_DEJAVUSANS16
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans16.c"
#include "DejaVuSans16.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS24_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS24_AA
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans24_aa.c"
#include "DejaVuSans24_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS24) && GDISP_INCLUDE_FONT_DEJAVUSANS24
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans24.c"
#include "DejaVuSans24.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS32_AA) && GDISP_INCLUDE_FONT_DEJAVUSANS32_AA
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans32_aa.c"
#include "DejaVuSans32_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANS32) && GDISP_INCLUDE_FONT_DEJAVUSANS32
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSans32.c"
#include "DejaVuSans32.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA) && GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSansBold12_aa.c"
#include "DejaVuSansBold12_aa.c"
#endif
#if defined(GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12) && GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/DejaVuSansBold12.c"
#include "DejaVuSansBold12.c"
#endif
#if defined(GDISP_INCLUDE_FONT_FIXED_10X20) && GDISP_INCLUDE_FONT_FIXED_10X20
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/fixed_10x20.c"
#include "fixed_10x20.c"
#endif
#if defined(GDISP_INCLUDE_FONT_FIXED_5X8) && GDISP_INCLUDE_FONT_FIXED_5X8
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/fixed_5x8.c"
#include "fixed_5x8.c"
#endif
#if defined(GDISP_INCLUDE_FONT_FIXED_7X14) && GDISP_INCLUDE_FONT_FIXED_7X14
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/fixed_7x14.c"
#include "fixed_7x14.c"
#endif
#if defined(GDISP_INCLUDE_FONT_LARGENUMBERS) && GDISP_INCLUDE_FONT_LARGENUMBERS
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/LargeNumbers.c"
#include "LargeNumbers.c"
#endif
#if defined(GDISP_INCLUDE_FONT_UI1) && GDISP_INCLUDE_FONT_UI1
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/UI1.c"
#include "UI1.c"
#endif
#if defined(GDISP_INCLUDE_FONT_UI2) && GDISP_INCLUDE_FONT_UI2
#define GDISP_FONT_FOUND
#include "src/gdisp/fonts/UI2.c"
#include "UI2.c"
#endif
#if defined(GDISP_INCLUDE_USER_FONTS) && GDISP_INCLUDE_USER_FONTS

2
src/gdisp/colors.h → src/gdisp/gdisp_colors.h

@ -6,7 +6,7 @@
*/
/**
* @file src/gdisp/colors.h
* @file src/gdisp/gdisp_colors.h
* @brief GDISP color definitions header file.
*
* @defgroup Colors Colors

4
src/gdisp/fonts.c → src/gdisp/gdisp_fonts.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gdisp/fonts.c
* @file src/gdisp/gdisp_fonts.c
* @brief GDISP Font Handling.
*
* @addtogroup GDISP
@ -17,7 +17,7 @@
#if GFX_USE_GDISP && GDISP_NEED_TEXT
#include "mcufont.h"
#include "mcufont/mcufont.h"
/* Custom flag to indicate dynamically allocated font */
#define FONT_FLAG_DYNAMIC 0x80

6
src/gdisp/gdisp.c → src/gdisp/gdisp_gdisp.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gdisp/gdisp.c
* @file src/gdisp/gdisp_gdisp.c
* @brief GDISP Driver code.
*
* @addtogroup GDISP
@ -17,7 +17,7 @@
#if GFX_USE_GDISP
/* Include the low level driver information */
#include "src/gdisp/driver.h"
#include "driver.h"
#if 1
#undef INLINE
@ -2768,7 +2768,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
#endif
#if GDISP_NEED_TEXT
#include "mcufont.h"
#include "mcufont/mcufont.h"
#if GDISP_NEED_ANTIALIAS && GDISP_HARDWARE_PIXELREAD
static void drawcharline(int16_t x, int16_t y, uint8_t count, uint8_t alpha, void *state) {

2
src/gdisp/image.c → src/gdisp/gdisp_image.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gdisp/image.c
* @file src/gdisp/gdisp_image.c
* @brief GDISP generic image code.
*
* @defgroup Image Image

2
src/gdisp/image.h → src/gdisp/gdisp_image.h

@ -6,7 +6,7 @@
*/
/**
* @file src/gdisp/image.h
* @file src/gdisp/gdisp_image.h
* @brief GDISP image header file.
*
* @defgroup Image Image

0
src/gdisp/image_bmp.c → src/gdisp/gdisp_image_bmp.c

0
src/gdisp/image_gif.c → src/gdisp/gdisp_image_gif.c

0
src/gdisp/image_jpg.c → src/gdisp/gdisp_image_jpg.c

0
src/gdisp/image_native.c → src/gdisp/gdisp_image_native.c

0
src/gdisp/image_png.c → src/gdisp/gdisp_image_png.c

4
src/gdisp/sys_defs.h

@ -185,7 +185,7 @@ extern GDisplay *GDISP;
/*===========================================================================*/
/* Load our color definitions and pixel formats */
#include "colors.h"
#include "gdisp_colors.h"
/**
* @brief The type of a pixel.
@ -995,7 +995,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
#endif
#if GDISP_NEED_IMAGE || defined(__DOXYGEN__)
#include "src/gdisp/image.h"
#include "gdisp_image.h"
#endif
#endif /* GFX_USE_GDISP */

16
src/gdisp/sys_make.mk

@ -1,11 +1,11 @@
GFXSRC += $(GFXLIB)/src/gdisp/gdisp.c \
$(GFXLIB)/src/gdisp/fonts.c \
$(GFXLIB)/src/gdisp/image.c \
$(GFXLIB)/src/gdisp/image_native.c \
$(GFXLIB)/src/gdisp/image_gif.c \
$(GFXLIB)/src/gdisp/image_bmp.c \
$(GFXLIB)/src/gdisp/image_jpg.c \
$(GFXLIB)/src/gdisp/image_png.c
GFXSRC += $(GFXLIB)/src/gdisp/gdisp_gdisp.c \
$(GFXLIB)/src/gdisp/gdisp_fonts.c \
$(GFXLIB)/src/gdisp/gdisp_image.c \
$(GFXLIB)/src/gdisp/gdisp_image_native.c \
$(GFXLIB)/src/gdisp/gdisp_image_gif.c \
$(GFXLIB)/src/gdisp/gdisp_image_bmp.c \
$(GFXLIB)/src/gdisp/gdisp_image_jpg.c \
$(GFXLIB)/src/gdisp/gdisp_image_png.c
MFDIR = $(GFXLIB)/src/gdisp/mcufont
include $(GFXLIB)/src/gdisp/mcufont/mcufont.mk

2
src/gevent/gevent.c → src/gevent/gevent_gevent.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gevent/gevent.c
* @file src/gevent/gevent_gevent.c
* @brief GEVENT Driver code.
*
* @addtogroup GEVENT

2
src/gevent/sys_make.mk

@ -1 +1 @@
GFXSRC += $(GFXLIB)/src/gevent/gevent.c
GFXSRC += $(GFXLIB)/src/gevent/gevent_gevent.c

8
src/gfile/fatfs_chibios_diskio.c → src/gfile/gfile_fatfs_diskio_chibios.c

@ -5,11 +5,17 @@
/* disk I/O modules and attach it to FatFs module with common interface. */
/*-----------------------------------------------------------------------*/
/**
* @file src/gfile/gfile_fatfs_diskio_chibios.c
* @brief GFILE FATFS wrapper.
*
*/
#include "gfx.h"
#if GFX_USE_GFILE && GFILE_NEED_FATFS && GFX_USE_OS_CHIBIOS
#include "fatfs_wrapper.h"
#include "gfile_fatfs_wrapper.h"
#if HAL_USE_MMC_SPI && HAL_USE_SDC
#error "cannot specify both MMC_SPI and SDC drivers"

4
src/gfile/fatfs_wrapper.c → src/gfile/gfile_fatfs_wrapper.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gfile/fatfs_wrapper.c
* @file src/gfile/gfile_fatfs_wrapper.c
* @brief GFILE FATFS wrapper.
*
*/
@ -15,7 +15,7 @@
#if GFX_USE_GFILE && GFILE_NEED_FATFS
#include "fatfs_wrapper.h"
#include "gfile_fatfs_wrapper.h"
// Include the source we want
#include "3rdparty/fatfs-0.10b/src/ff.c"

2
src/gfile/fatfs_wrapper.h → src/gfile/gfile_fatfs_wrapper.h

@ -6,7 +6,7 @@
*/
/**
* @file src/gfile/fatfs_wrapper.h
* @file src/gfile/gfile_fatfs_wrapper.h
* @brief GFILE FATFS wrapper.
*
*/

0
src/gfile/inc_chibiosfs.c → src/gfile/gfile_fs_chibios.c

0
src/gfile/inc_fatfs.c → src/gfile/gfile_fs_fatfs.c

0
src/gfile/inc_memfs.c → src/gfile/gfile_fs_mem.c

1
src/gfile/inc_nativefs.c → src/gfile/gfile_fs_native.c

@ -18,7 +18,6 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
//#include <unistd.h>
static bool_t NativeDel(const char *fname);
static bool_t NativeExists(const char *fname);

0
src/gfile/inc_petitfs.c → src/gfile/gfile_fs_petitfs.c

0
src/gfile/inc_ramfs.c → src/gfile/gfile_fs_ram.c

0
src/gfile/inc_romfs.c → src/gfile/gfile_fs_rom.c

0
src/gfile/inc_strings.c → src/gfile/gfile_fs_strings.c

2
src/gfile/gfile.c → src/gfile/gfile_gfile.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gfile/gfile.c
* @file src/gfile/gfile_gfile.c
* @brief GFILE code.
*
*/

8
src/gfile/petitfs_chibios_diskio.c → src/gfile/gfile_petitfs_diskio_chibios.c

@ -5,11 +5,17 @@
/* disk I/O modules and attach it to FatFs module with common interface. */
/*-----------------------------------------------------------------------*/
/**
* @file src/gfile/gfile_petitfs_diskio_chibios.c
* @brief GFILE FATFS wrapper.
*
*/
#include "gfx.h"
#if GFX_USE_GFILE && GFILE_NEED_PETITFS && GFX_USE_OS_CHIBIOS
#include "petitfs_wrapper.h"
#include "gfile_petitfs_wrapper.h"
#include <string.h>

4
src/gfile/petitfs_wrapper.c → src/gfile/gfile_petitfs_wrapper.c

@ -6,7 +6,7 @@
*/
/**
* @file src/gfile/petitfs_wrapper.c
* @file src/gfile/gfile_petitfs_wrapper.c
* @brief GFILE PETITFS wrapper.
*
*/
@ -15,7 +15,7 @@
#if GFX_USE_GFILE && GFILE_NEED_PETITFS
#include "petitfs_wrapper.h"
#include "gfile_petitfs_wrapper.h"
// Include the source we want
#include "3rdparty/petitfs-0.03/src/pff.c"

2
src/gfile/petitfs_wrapper.h → src/gfile/gfile_petitfs_wrapper.h

@ -6,7 +6,7 @@
*/
/**
* @file src/gfile/petitfs_wrapper.h
* @file src/gfile/gfile_petitfs_wrapper.h
* @brief GFILE PETITFS wrapper.
*
*/

0
src/gfile/inc_printg.c → src/gfile/gfile_printg.c

0
src/gfile/inc_scang.c → src/gfile/gfile_scang.c

0
src/gfile/inc_stdio.c → src/gfile/gfile_stdio.c

32
src/gfile/sys_make.mk

@ -1,18 +1,18 @@
GFXSRC += $(GFXLIB)/src/gfile/gfile.c \
$(GFXLIB)/src/gfile/inc_nativefs.c \
$(GFXLIB)/src/gfile/inc_ramfs.c \
$(GFXLIB)/src/gfile/inc_romfs.c \
$(GFXLIB)/src/gfile/inc_fatfs.c \
$(GFXLIB)/src/gfile/inc_petitfs.c \
$(GFXLIB)/src/gfile/inc_memfs.c \
$(GFXLIB)/src/gfile/inc_chibiosfs.c \
$(GFXLIB)/src/gfile/inc_strings.c \
$(GFXLIB)/src/gfile/inc_printg.c \
$(GFXLIB)/src/gfile/inc_scang.c \
$(GFXLIB)/src/gfile/inc_stdio.c \
$(GFXLIB)/src/gfile/fatfs_wrapper.c \
$(GFXLIB)/src/gfile/fatfs_chibios_diskio.c \
$(GFXLIB)/src/gfile/petitfs_wrapper.c \
$(GFXLIB)/src/gfile/petitfs_chibios_diskio.c \
GFXSRC += $(GFXLIB)/src/gfile/gfile_gfile.c \
$(GFXLIB)/src/gfile/gfile_fs_native.c \
$(GFXLIB)/src/gfile/gfile_fs_ram.c \
$(GFXLIB)/src/gfile/gfile_fs_rom.c \
$(GFXLIB)/src/gfile/gfile_fs_fatfs.c \
$(GFXLIB)/src/gfile/gfile_fs_petitfs.c \
$(GFXLIB)/src/gfile/gfile_fs_mem.c \
$(GFXLIB)/src/gfile/gfile_fs_chibios.c \
$(GFXLIB)/src/gfile/gfile_fs_strings.c \
$(GFXLIB)/src/gfile/gfile_printg.c \
$(GFXLIB)/src/gfile/gfile_scang.c \
$(GFXLIB)/src/gfile/gfile_stdio.c \
$(GFXLIB)/src/gfile/gfile_fatfs_wrapper.c \
$(GFXLIB)/src/gfile/gfile_fatfs_diskio_chibios.c \
$(GFXLIB)/src/gfile/gfile_petitfs_wrapper.c \
$(GFXLIB)/src/gfile/gfile_petitfs_diskio_chibios.c \

4
src/ginput/dial.c → src/ginput/ginput_dial.c

@ -6,7 +6,7 @@
*/
/**
* @file src/ginput/dial.c
* @file src/ginput/ginput_dial.c
* @brief GINPUT dial code.
*
* @defgroup Dial Dial
@ -17,7 +17,7 @@
#if GFX_USE_GINPUT && GINPUT_NEED_DIAL
#include "src/ginput/driver_dial.h"
#include "driver_dial.h"
static GTIMER_DECL(DialTimer);
static struct DialStatus_t {

2
src/ginput/dial.h → src/ginput/ginput_dial.h

@ -6,7 +6,7 @@
*/
/**
* @file src/ginput/dial.h
* @file src/ginput/ginput_dial.h
* @brief GINPUT GFX User Input subsystem header file.
*
* @defgroup Dial Dial

2
src/ginput/ginput.c → src/ginput/ginput_ginput.c

@ -6,7 +6,7 @@
*/
/**
* @file src/ginput/ginput.c
* @file src/ginput/ginput_ginput.c
* @brief GINPUT subsystem common code.
*
* @addtogroup GINPUT

46
src/ginput/keyboard.c → src/ginput/ginput_keyboard.c

@ -1,23 +1,23 @@
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file src/ginput/keyboard.c
* @brief GINPUT keyboard code.
*
* @defgroup Keyboard Keyboard
* @ingroup GINPUT
*
* @{
*/
#include "gfx.h"
#if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || defined(__DOXYGEN__)
#error "GINPUT: GINPUT_NEED_KEYBOARD - Not Implemented Yet"
#endif /* GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD */
/** @} */
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file src/ginput/ginput_keyboard.c
* @brief GINPUT keyboard code.
*
* @defgroup Keyboard Keyboard
* @ingroup GINPUT
*
* @{
*/
#include "gfx.h"
#if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || defined(__DOXYGEN__)
#error "GINPUT: GINPUT_NEED_KEYBOARD - Not Implemented Yet"
#endif /* GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD */
/** @} */

2
src/ginput/keyboard.h → src/ginput/ginput_keyboard.h

@ -6,7 +6,7 @@
*/
/**
* @file src/ginput/keyboard.h
* @file src/ginput/ginput_keyboard.h
* @brief GINPUT GFX User Input subsystem header file.
*
* @defgroup Keyboard Keyboard

4
src/ginput/mouse.c → src/ginput/ginput_mouse.c

@ -6,7 +6,7 @@
*/
/**
* @file src/ginput/mouse.c
* @file src/ginput/ginput_mouse.c
* @brief GINPUT mouse/touch code.
*
* @defgroup Mouse Mouse
@ -17,7 +17,7 @@
#if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) || defined(__DOXYGEN__)
#include "src/ginput/driver_mouse.h"
#include "driver_mouse.h"
#if GINPUT_MOUSE_NEED_CALIBRATION
#if !defined(GFX_USE_GDISP) || !GFX_USE_GDISP

2
src/ginput/mouse.h → src/ginput/ginput_mouse.h

@ -6,7 +6,7 @@
*/
/**
* @file src/ginput/mouse.h
* @file src/ginput/ginput_mouse.h
* @brief GINPUT GFX User Input subsystem header file for mouse and touch.
*
* @defgroup Mouse Mouse

312
src/ginput/toggle.c → src/ginput/ginput_toggle.c

@ -1,156 +1,156 @@
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file src/ginput/toggle.c
* @brief GINPUT toggle code.
*
* @defgroup Toggle Toggle
* @ingroup GINPUT
* @{
*/
#include "gfx.h"
#if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) || defined(__DOXYGEN__)
#include "src/ginput/driver_toggle.h"
#define GINPUT_TOGGLE_ISON 0x01
#define GINPUT_TOGGLE_INVERT 0x02
static GTIMER_DECL(ToggleTimer);
static struct GEventToggleStatus_t {
uint8_t status;
} ToggleStatus[GINPUT_TOGGLE_NUM_PORTS];
// Our polling function
static void TogglePoll(void *param) {
(void) param;
const GToggleConfig *ptc;
GSourceListener *psl;
GEventToggle *pe;
unsigned i, bits, mask;
uint8_t state;
// Loop while there are bits to get
for(ptc = GInputToggleConfigTable, i=0; i < GINPUT_TOGGLE_NUM_PORTS; ptc++) {
// Get the next block of bits
bits = ginput_lld_toggle_getbits(ptc) ^ ptc->invert;
// Extract the bits of use
for(mask = ptc->mask; i < GINPUT_TOGGLE_NUM_PORTS && mask; mask >>= 1, bits >>= 1) {
// Ignore bits not in our mask
if (!(mask & 1))
continue;
// Calculate our new state
state = ToggleStatus[i].status & ~GINPUT_TOGGLE_ISON;
if (state & GINPUT_TOGGLE_INVERT)
bits ^= 1;
if (bits & 1)
state |= GINPUT_TOGGLE_ISON;
// Has it changed?
if ((state ^ ToggleStatus[i].status) & GINPUT_TOGGLE_ISON) {
// Save the new state
ToggleStatus[i].status = state;
// Send the event to the listeners that are interested.
psl = 0;
while ((psl = geventGetSourceListener((GSourceHandle)(ToggleStatus+i), psl))) {
if (!(pe = (GEventToggle *)geventGetEventBuffer(psl)))
continue;
if ((state & GINPUT_TOGGLE_ISON)) {
if ((psl->listenflags & GLISTEN_TOGGLE_ON)) {
pe->type = GEVENT_TOGGLE;
pe->instance = i;
pe->on = TRUE;
geventSendEvent(psl);
}
} else {
if ((psl->listenflags & GLISTEN_TOGGLE_OFF)) {
pe->type = GEVENT_TOGGLE;
pe->instance = i;
pe->on = FALSE;
geventSendEvent(psl);
}
}
}
}
// Next toggle switch
i++;
}
}
}
/* Hardware Toggle/Switch/Button Functions */
GSourceHandle ginputGetToggle(uint16_t instance) {
const GToggleConfig *ptc;
if (instance >= GINPUT_TOGGLE_NUM_PORTS)
return 0;
// Do we need to initialise the toggle subsystem?
if (!gtimerIsActive(&ToggleTimer)) {
for(ptc = GInputToggleConfigTable; ptc < GInputToggleConfigTable+sizeof(GInputToggleConfigTable)/sizeof(GInputToggleConfigTable[0]); ptc++)
ginput_lld_toggle_init(ptc);
gtimerStart(&ToggleTimer, TogglePoll, 0, TRUE, GINPUT_TOGGLE_POLL_PERIOD);
}
// OK - return this input
return (GSourceHandle)(ToggleStatus+instance);
}
// If invert is true, invert the on/off sense for the toggle
void ginputInvertToggle(uint16_t instance, bool_t invert) {
if (instance >= GINPUT_TOGGLE_NUM_PORTS)
return;
if (invert) {
if (!(ToggleStatus[instance].status & GINPUT_TOGGLE_INVERT)) {
ToggleStatus[instance].status |= GINPUT_TOGGLE_INVERT;
ToggleStatus[instance].status ^= GINPUT_TOGGLE_ISON;
}
} else {
if ((ToggleStatus[instance].status & GINPUT_TOGGLE_INVERT)) {
ToggleStatus[instance].status &= ~GINPUT_TOGGLE_INVERT;
ToggleStatus[instance].status ^= GINPUT_TOGGLE_ISON;
}
}
}
/* Get the current toggle status.
* Returns FALSE on error (eg invalid instance)
*/
bool_t ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle) {
// Win32 threads don't seem to recognise priority and/or pre-emption
// so we add a sleep here to prevent 100% polled applications from locking up.
gfxSleepMilliseconds(1);
if (instance >= GINPUT_TOGGLE_NUM_PORTS)
return FALSE;
ptoggle->type = GEVENT_TOGGLE;
ptoggle->instance = instance;
ptoggle->on = (ToggleStatus[instance].status & GINPUT_TOGGLE_ISON) ? TRUE : FALSE;
return TRUE;
}
/* Wake up the mouse driver from an interrupt service routine (there may be new readings available) */
void ginputToggleWakeup(void) {
gtimerJab(&ToggleTimer);
}
/* Wake up the mouse driver from an interrupt service routine (there may be new readings available) */
void ginputToggleWakeupI(void) {
gtimerJabI(&ToggleTimer);
}
#endif /* GFX_USE_GINPUT && GINPUT_NEED_TOGGLE */
/** @} */
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file src/ginput/ginput_toggle.c
* @brief GINPUT toggle code.
*
* @defgroup Toggle Toggle
* @ingroup GINPUT
* @{
*/
#include "gfx.h"
#if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) || defined(__DOXYGEN__)
#include "driver_toggle.h"
#define GINPUT_TOGGLE_ISON 0x01
#define GINPUT_TOGGLE_INVERT 0x02
static GTIMER_DECL(ToggleTimer);
static struct GEventToggleStatus_t {
uint8_t status;
} ToggleStatus[GINPUT_TOGGLE_NUM_PORTS];
// Our polling function
static void TogglePoll(void *param) {
(void) param;
const GToggleConfig *ptc;
GSourceListener *psl;
GEventToggle *pe;
unsigned i, bits, mask;
uint8_t state;
// Loop while there are bits to get
for(ptc = GInputToggleConfigTable, i=0; i < GINPUT_TOGGLE_NUM_PORTS; ptc++) {
// Get the next block of bits
bits = ginput_lld_toggle_getbits(ptc) ^ ptc->invert;
// Extract the bits of use
for(mask = ptc->mask; i < GINPUT_TOGGLE_NUM_PORTS && mask; mask >>= 1, bits >>= 1) {
// Ignore bits not in our mask
if (!(mask & 1))
continue;
// Calculate our new state
state = ToggleStatus[i].status & ~GINPUT_TOGGLE_ISON;
if (state & GINPUT_TOGGLE_INVERT)
bits ^= 1;
if (bits & 1)
state |= GINPUT_TOGGLE_ISON;
// Has it changed?
if ((state ^ ToggleStatus[i].status) & GINPUT_TOGGLE_ISON) {
// Save the new state
ToggleStatus[i].status = state;
// Send the event to the listeners that are interested.
psl = 0;
while ((psl = geventGetSourceListener((GSourceHandle)(ToggleStatus+i), psl))) {
if (!(pe = (GEventToggle *)geventGetEventBuffer(psl)))
continue;
if ((state & GINPUT_TOGGLE_ISON)) {
if ((psl->listenflags & GLISTEN_TOGGLE_ON)) {
pe->type = GEVENT_TOGGLE;
pe->instance = i;
pe->on = TRUE;
geventSendEvent(psl);
}
} else {
if ((psl->listenflags & GLISTEN_TOGGLE_OFF)) {
pe->type = GEVENT_TOGGLE;
pe->instance = i;
pe->on = FALSE;
geventSendEvent(psl);
}
}
}
}
// Next toggle switch
i++;
}
}
}
/* Hardware Toggle/Switch/Button Functions */
GSourceHandle ginputGetToggle(uint16_t instance) {
const GToggleConfig *ptc;
if (instance >= GINPUT_TOGGLE_NUM_PORTS)
return 0;
// Do we need to initialise the toggle subsystem?
if (!gtimerIsActive(&ToggleTimer)) {
for(ptc = GInputToggleConfigTable; ptc < GInputToggleConfigTable+sizeof(GInputToggleConfigTable)/sizeof(GInputToggleConfigTable[0]); ptc++)
ginput_lld_toggle_init(ptc);
gtimerStart(&ToggleTimer, TogglePoll, 0, TRUE, GINPUT_TOGGLE_POLL_PERIOD);
}
// OK - return this input
return (GSourceHandle)(ToggleStatus+instance);
}
// If invert is true, invert the on/off sense for the toggle
void ginputInvertToggle(uint16_t instance, bool_t invert) {
if (instance >= GINPUT_TOGGLE_NUM_PORTS)
return;
if (invert) {
if (!(ToggleStatus[instance].status & GINPUT_TOGGLE_INVERT)) {
ToggleStatus[instance].status |= GINPUT_TOGGLE_INVERT;
ToggleStatus[instance].status ^= GINPUT_TOGGLE_ISON;
}
} else {
if ((ToggleStatus[instance].status & GINPUT_TOGGLE_INVERT)) {
ToggleStatus[instance].status &= ~GINPUT_TOGGLE_INVERT;
ToggleStatus[instance].status ^= GINPUT_TOGGLE_ISON;
}
}
}
/* Get the current toggle status.
* Returns FALSE on error (eg invalid instance)
*/
bool_t ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle) {
// Win32 threads don't seem to recognise priority and/or pre-emption
// so we add a sleep here to prevent 100% polled applications from locking up.
gfxSleepMilliseconds(1);
if (instance >= GINPUT_TOGGLE_NUM_PORTS)
return FALSE;
ptoggle->type = GEVENT_TOGGLE;
ptoggle->instance = instance;
ptoggle->on = (ToggleStatus[instance].status & GINPUT_TOGGLE_ISON) ? TRUE : FALSE;
return TRUE;
}
/* Wake up the mouse driver from an interrupt service routine (there may be new readings available) */
void ginputToggleWakeup(void) {
gtimerJab(&ToggleTimer);
}
/* Wake up the mouse driver from an interrupt service routine (there may be new readings available) */
void ginputToggleWakeupI(void) {
gtimerJabI(&ToggleTimer);
}
#endif /* GFX_USE_GINPUT && GINPUT_NEED_TOGGLE */
/** @} */

2
src/ginput/toggle.h → src/ginput/ginput_toggle.h

@ -6,7 +6,7 @@
*/
/**
* @file src/ginput/toggle.h
* @file src/ginput/ginput_toggle.h
* @brief GINPUT GFX User Input subsystem header file.
*
* @defgroup Toggle Toggle

8
src/ginput/sys_defs.h

@ -39,10 +39,10 @@
*/
// Include various ginput types
#include "src/ginput/mouse.h"
#include "src/ginput/keyboard.h"
#include "src/ginput/toggle.h"
#include "src/ginput/dial.h"
#include "ginput_mouse.h"
#include "ginput_keyboard.h"
#include "ginput_toggle.h"
#include "ginput_dial.h"
#endif /* GFX_USE_GINPUT */

10
src/ginput/sys_make.mk

@ -1,5 +1,5 @@
GFXSRC += $(GFXLIB)/src/ginput/ginput.c \
$(GFXLIB)/src/ginput/mouse.c \
$(GFXLIB)/src/ginput/keyboard.c \
$(GFXLIB)/src/ginput/toggle.c \
$(GFXLIB)/src/ginput/dial.c
GFXSRC += $(GFXLIB)/src/ginput/ginput_ginput.c \
$(GFXLIB)/src/ginput/ginput_mouse.c \
$(GFXLIB)/src/ginput/ginput_keyboard.c \
$(GFXLIB)/src/ginput/ginput_toggle.c \
$(GFXLIB)/src/ginput/ginput_dial.c

452
src/gmisc/arrayops.c → src/gmisc/gmisc_arrayops.c

@ -1,226 +1,226 @@
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file src/gmisc/arrayops.c
* @brief GMISC Array Operations code.
*
* @addtogroup GMISC
* @{
*/
#include "gfx.h"
#if GFX_USE_GMISC && GMISC_NEED_ARRAYOPS
void gmiscArrayConvert(ArrayDataFormat srcfmt, void *src, ArrayDataFormat dstfmt, void *dst, size_t cnt) {
uint8_t *src8, *dst8;
uint16_t *src16, *dst16;
dst8 = dst;
dst16 = dst;
src8 = src;
src16 = src;
/* We do this as a big switch in order to optimise efficiency for each transfer type */
switch(dstfmt) {
case ARRAY_DATA_4BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: if (dst != src) while(cnt--) { *dst8++ = *src8++; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 8); } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst8++ = *src8++ >> 4; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 128) >> 4; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 6; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 512) >> 6; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 8; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 2048) >> 8; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 10; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 8192) >> 10; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 12; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 32768) >> 12; } break;
}
break;
case ARRAY_DATA_4BITSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 8); } break;
case ARRAY_DATA_4BITSIGNED: if (dst != src) while(cnt--) { *dst8++ = *src8++; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 128) >> 4; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst8++ = *src8++ >> 4; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 512) >> 6; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 6; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 2048) >> 8; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 8; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 8192) >> 10; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 10; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 32768) >> 12; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 12; } break;
}
break;
case ARRAY_DATA_8BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst8++ = *src8++ << 4; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 8) << 4; } break;
case ARRAY_DATA_8BITUNSIGNED: if (dst != src) while(cnt--) { *dst8++ = *src8++; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 128); } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 2; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 512) >> 2; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 4; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 2048) >> 4; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 6; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 8192) >> 6; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 8; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 32768) >> 8; } break;
}
break;
case ARRAY_DATA_8BITSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 8) << 4; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst8++ = *src8++ << 4; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 128); } break;
case ARRAY_DATA_8BITSIGNED: if (dst != src) while(cnt--) { *dst8++ = *src8++; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 512) >> 2; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 2; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 2048) >> 4; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 4; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 8192) >> 6; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 6; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 32768) >> 8; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 8; } break;
}
break;
case ARRAY_DATA_10BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 6; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 6; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 2; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 2; } break;
case ARRAY_DATA_10BITUNSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512); } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048) >> 2; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ >> 4; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192) >> 4; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ >> 6; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768) >> 6; } break;
}
break;
case ARRAY_DATA_10BITSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 6; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 6; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 2; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 2; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512); } break;
case ARRAY_DATA_10BITSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048) >> 2; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192) >> 4; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst16++ = *src16++ >> 4; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768) >> 6; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst16++ = *src16++ >> 6; } break;
}
break;
case ARRAY_DATA_12BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 8; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 8; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 4; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 4; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ << 2; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512) << 2; } break;
case ARRAY_DATA_12BITUNSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048); } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192) >> 2; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ >> 4; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768) >> 4; } break;
}
break;
case ARRAY_DATA_12BITSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 8; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 8; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 4; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 4; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512) << 2; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst16++ = *src16++ << 2; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048); } break;
case ARRAY_DATA_12BITSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192) >> 2; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768) >> 4; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst16++ = *src16++ >> 4; } break;
}
break;
case ARRAY_DATA_14BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 10; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 10; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 6; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 6; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ << 4; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512) << 4; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ << 2; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048) >> 2; } break;
case ARRAY_DATA_14BITUNSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192); } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768) >> 2; } break;
}
break;
case ARRAY_DATA_14BITSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 10; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 10; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 6; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 6; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512) << 4; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst16++ = *src16++ << 4; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048) << 2; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst16++ = *src16++ << 2; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192); } break;
case ARRAY_DATA_14BITSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768) >> 2; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
}
break;
case ARRAY_DATA_16BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 12; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 12; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = *src8++ << 8; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 8; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ << 6; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512) << 6; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ << 4; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048) >> 4; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192) >> 2; } break;
case ARRAY_DATA_16BITUNSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768); } break;
}
break;
case ARRAY_DATA_16BITSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 8) << 12; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 12; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst16++ = (*src8++ ^ 128) << 8; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst16++ = *src8++ << 8; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 512) << 6; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst16++ = *src16++ << 6; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 2048) << 4; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst16++ = *src16++ << 4; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 8192) << 2; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst16++ = *src16++ >> 2; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst16++ = (*src16++ ^ 32768); } break;
case ARRAY_DATA_16BITSIGNED: if (dst != src) while(cnt--) { *dst16++ = *src16++; } break;
}
break;
}
}
#endif /* GFX_USE_GMISC && GMISC_NEED_ARRAYOPS */
/** @} */
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file src/gmisc/gmisc_arrayops.c
* @brief GMISC Array Operations code.
*
* @addtogroup GMISC
* @{
*/
#include "gfx.h"
#if GFX_USE_GMISC && GMISC_NEED_ARRAYOPS
void gmiscArrayConvert(ArrayDataFormat srcfmt, void *src, ArrayDataFormat dstfmt, void *dst, size_t cnt) {
uint8_t *src8, *dst8;
uint16_t *src16, *dst16;
dst8 = dst;
dst16 = dst;
src8 = src;
src16 = src;
/* We do this as a big switch in order to optimise efficiency for each transfer type */
switch(dstfmt) {
case ARRAY_DATA_4BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: if (dst != src) while(cnt--) { *dst8++ = *src8++; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 8); } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst8++ = *src8++ >> 4; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 128) >> 4; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 6; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 512) >> 6; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 8; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 2048) >> 8; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 10; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 8192) >> 10; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 12; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 32768) >> 12; } break;
}
break;
case ARRAY_DATA_4BITSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 8); } break;
case ARRAY_DATA_4BITSIGNED: if (dst != src) while(cnt--) { *dst8++ = *src8++; } break;
case ARRAY_DATA_8BITUNSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 128) >> 4; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst8++ = *src8++ >> 4; } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 512) >> 6; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 6; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 2048) >> 8; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 8; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 8192) >> 10; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 10; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 32768) >> 12; } break;
case ARRAY_DATA_16BITSIGNED: while(cnt--) { *dst8++ = *src16++ >> 12; } break;
}
break;
case ARRAY_DATA_8BITUNSIGNED:
switch(srcfmt) {
case ARRAY_DATA_4BITUNSIGNED: while(cnt--) { *dst8++ = *src8++ << 4; } break;
case ARRAY_DATA_4BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 8) << 4; } break;
case ARRAY_DATA_8BITUNSIGNED: if (dst != src) while(cnt--) { *dst8++ = *src8++; } break;
case ARRAY_DATA_8BITSIGNED: while(cnt--) { *dst8++ = (*src8++ ^ 128); } break;
case ARRAY_DATA_10BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 2; } break;
case ARRAY_DATA_10BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 512) >> 2; } break;
case ARRAY_DATA_12BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 4; } break;
case ARRAY_DATA_12BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 2048) >> 4; } break;
case ARRAY_DATA_14BITUNSIGNED: while(cnt--) { *dst8++ = *src16++ >> 6; } break;
case ARRAY_DATA_14BITSIGNED: while(cnt--) { *dst8++ = (*src16++ ^ 8192) >> 6; } break;
case ARRAY_DATA_16BITUNSIGNED: while(cnt--