From c5a86757bd8309027d50f82d8947250c8e1197e6 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 21 Nov 2015 19:27:08 +1000 Subject: Make all include paths in ugfx relative. The only include path now needed is for drivers (in particular GDISP drivers) --- .../stm32f746g_discovery_sdram.c | 2 +- .../STM32F746-Discovery/stm32f746g_raw32_system.c | 2 +- .../STM32F746-Discovery/stm32f746g_raw32_ugfx.c | 2 +- drivers/gadc/AT91SAM7/driver.mk | 5 +- drivers/gadc/AT91SAM7/gadc_lld.c | 88 ----- drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c | 88 +++++ drivers/gaudio/Win32/driver.mk | 6 +- drivers/gaudio/Win32/gaudio_play_Win32.c | 183 +++++++++++ drivers/gaudio/Win32/gaudio_play_lld.c | 183 ----------- drivers/gaudio/Win32/gaudio_record_Win32.c | 185 +++++++++++ drivers/gaudio/Win32/gaudio_record_lld.c | 185 ----------- drivers/gaudio/gadc/driver.mk | 5 +- drivers/gaudio/gadc/gaudio_record_gadc.c | 55 ++++ drivers/gaudio/gadc/gaudio_record_lld.c | 55 ---- drivers/gaudio/pwm/driver.mk | 5 +- drivers/gaudio/pwm/gaudio_play_lld.c | 117 ------- drivers/gaudio/pwm/gaudio_play_pwm.c | 117 +++++++ drivers/gaudio/vs1053/driver.mk | 7 +- drivers/gaudio/vs1053/gaudio_play_lld.c | 361 --------------------- drivers/gaudio/vs1053/gaudio_play_vs1053.c | 361 +++++++++++++++++++++ drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c | 4 +- drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c | 6 +- drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c | 4 +- drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c | 4 +- drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c | 6 +- drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c | 4 +- drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c | 4 +- drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c | 2 +- .../gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c | 6 +- .../gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 6 +- drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c | 6 +- drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c | 6 +- drivers/gdisp/R61505U/gdisp_lld_R61505U.c | 4 +- drivers/gdisp/RA8875/gdisp_lld_RA8875.c | 4 +- drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c | 4 +- drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c | 4 +- drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c | 4 +- drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 6 +- drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c | 2 +- drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c | 2 +- drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c | 6 +- drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c | 6 +- drivers/gdisp/ST7565/gdisp_lld_ST7565.c | 6 +- .../gdisp_lld_STM32F429iDiscovery.c | 4 +- drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c | 4 +- drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c | 6 +- drivers/gdisp/TestStub/gdisp_lld_TestStub.c | 4 +- drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c | 4 +- drivers/ginput/dial/GADC/driver.mk | 5 +- drivers/ginput/dial/GADC/ginput_lld_dial.c | 76 ----- drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c | 76 +++++ drivers/ginput/toggle/Pal/driver.mk | 5 +- drivers/ginput/toggle/Pal/ginput_lld_toggle.c | 24 -- drivers/ginput/toggle/Pal/ginput_lld_toggle_Pal.c | 24 ++ drivers/ginput/touch/ADS7843/driver.mk | 1 - drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c | 2 +- drivers/ginput/touch/FT5x06/driver.mk | 1 - drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c | 4 +- drivers/ginput/touch/MAX11802/driver.mk | 1 - .../ginput/touch/MAX11802/gmouse_lld_MAX11802.c | 4 +- drivers/ginput/touch/MCU/driver.mk | 1 - drivers/ginput/touch/MCU/gmouse_lld_MCU.c | 2 +- drivers/ginput/touch/STMPE610/driver.mk | 1 - .../ginput/touch/STMPE610/gmouse_lld_STMPE610.c | 4 +- drivers/ginput/touch/STMPE811/driver.mk | 1 - .../ginput/touch/STMPE811/gmouse_lld_STMPE811.c | 4 +- drivers/multiple/Win32/gdisp_lld_Win32.c | 10 +- drivers/multiple/X/gdisp_lld_X.c | 8 +- drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c | 4 +- gfxconf.example.h | 5 +- src/gadc/gadc.c | 2 +- src/gadc/gadc.h | 2 +- src/gadc/gadc_driver.h | 2 +- src/gaudio/gaudio.c | 2 +- src/gaudio/gaudio.h | 2 +- src/gaudio/gaudio_driver_play.h | 2 +- src/gaudio/gaudio_driver_record.h | 2 +- src/gdisp/gdisp.c | 2 +- src/gdisp/gdisp.h | 3 +- src/gdisp/gdisp_colors.h | 2 +- src/gdisp/gdisp_driver.h | 2 +- src/gdisp/gdisp_fonts.c | 2 +- src/gdisp/gdisp_image.c | 2 +- src/gdisp/gdisp_image_bmp.c | 2 +- src/gdisp/gdisp_image_gif.c | 2 +- src/gdisp/gdisp_image_jpg.c | 2 +- src/gdisp/gdisp_image_native.c | 2 +- src/gdisp/gdisp_image_png.c | 2 +- src/gdisp/gdisp_pixmap.c | 6 +- src/gdisp/mcufont/mf_config.h | 2 +- src/gdriver/gdriver.c | 2 +- src/gevent/gevent.c | 2 +- src/gevent/gevent.h | 2 +- src/gfile/gfile.c | 2 +- src/gfile/gfile.h | 2 +- src/gfile/gfile_fatfs_diskio_chibios.c | 2 +- src/gfile/gfile_fatfs_wrapper.c | 6 +- src/gfile/gfile_fatfs_wrapper.h | 6 +- src/gfile/gfile_fs_chibios.c | 2 +- src/gfile/gfile_fs_fatfs.c | 2 +- src/gfile/gfile_fs_mem.c | 2 +- src/gfile/gfile_fs_native.c | 2 +- src/gfile/gfile_fs_petitfs.c | 2 +- src/gfile/gfile_fs_ram.c | 2 +- src/gfile/gfile_fs_rom.c | 2 +- src/gfile/gfile_fs_strings.c | 2 +- src/gfile/gfile_petitfs_diskio_chibios.c | 2 +- src/gfile/gfile_petitfs_wrapper.c | 4 +- src/gfile/gfile_petitfs_wrapper.h | 4 +- src/gfile/gfile_printg.c | 2 +- src/gfile/gfile_scang.c | 2 +- src/gfile/gfile_stdio.c | 2 +- src/gfx.c | 2 +- src/ginput/ginput.c | 2 +- src/ginput/ginput.h | 2 +- src/ginput/ginput_dial.c | 2 +- src/ginput/ginput_driver_keyboard.h | 2 +- src/ginput/ginput_driver_mouse.h | 2 +- src/ginput/ginput_keyboard.c | 2 +- src/ginput/ginput_keyboard_microcode.c | 2 +- src/ginput/ginput_mouse.c | 2 +- src/ginput/ginput_options.h | 40 +-- src/ginput/ginput_toggle.c | 2 +- src/gmisc/gmisc.c | 2 +- src/gmisc/gmisc.h | 2 +- src/gmisc/gmisc_arrayops.c | 2 +- src/gmisc/gmisc_matrix2d.c | 2 +- src/gmisc/gmisc_trig.c | 2 +- src/gos/gos.h | 22 +- src/gos/gos_arduino.c | 2 +- src/gos/gos_chibios.c | 2 +- src/gos/gos_cmsis.c | 2 +- src/gos/gos_ecos.c | 2 +- src/gos/gos_freertos.c | 2 +- src/gos/gos_linux.c | 2 +- src/gos/gos_osx.c | 2 +- src/gos/gos_raw32.c | 2 +- src/gos/gos_rawrtos.c | 2 +- src/gos/gos_win32.c | 2 +- src/gos/gos_x_heap.c | 2 +- src/gos/gos_x_threads.c | 2 +- src/gqueue/gqueue.c | 2 +- src/gtimer/gtimer.c | 2 +- src/gtimer/gtimer.h | 2 +- src/gwin/gwin.c | 2 +- src/gwin/gwin.h | 2 +- src/gwin/gwin_button.c | 2 +- src/gwin/gwin_checkbox.c | 2 +- src/gwin/gwin_console.c | 2 +- src/gwin/gwin_container.c | 2 +- src/gwin/gwin_frame.c | 2 +- src/gwin/gwin_gl3d.c | 44 +-- src/gwin/gwin_gl3d.h | 2 +- src/gwin/gwin_graph.c | 2 +- src/gwin/gwin_image.c | 2 +- src/gwin/gwin_keyboard.c | 2 +- src/gwin/gwin_keyboard_layout.c | 2 +- src/gwin/gwin_label.c | 2 +- src/gwin/gwin_list.c | 2 +- src/gwin/gwin_progressbar.c | 2 +- src/gwin/gwin_radio.c | 2 +- src/gwin/gwin_slider.c | 2 +- src/gwin/gwin_tabset.c | 2 +- src/gwin/gwin_textedit.c | 2 +- src/gwin/gwin_widget.c | 2 +- src/gwin/gwin_wm.c | 2 +- 166 files changed, 1341 insertions(+), 1371 deletions(-) delete mode 100644 drivers/gadc/AT91SAM7/gadc_lld.c create mode 100644 drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c create mode 100644 drivers/gaudio/Win32/gaudio_play_Win32.c delete mode 100644 drivers/gaudio/Win32/gaudio_play_lld.c create mode 100644 drivers/gaudio/Win32/gaudio_record_Win32.c delete mode 100644 drivers/gaudio/Win32/gaudio_record_lld.c create mode 100644 drivers/gaudio/gadc/gaudio_record_gadc.c delete mode 100644 drivers/gaudio/gadc/gaudio_record_lld.c delete mode 100644 drivers/gaudio/pwm/gaudio_play_lld.c create mode 100644 drivers/gaudio/pwm/gaudio_play_pwm.c delete mode 100644 drivers/gaudio/vs1053/gaudio_play_lld.c create mode 100644 drivers/gaudio/vs1053/gaudio_play_vs1053.c delete mode 100644 drivers/ginput/dial/GADC/ginput_lld_dial.c create mode 100644 drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c delete mode 100644 drivers/ginput/toggle/Pal/ginput_lld_toggle.c create mode 100644 drivers/ginput/toggle/Pal/ginput_lld_toggle_Pal.c diff --git a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c index 55e8987a..9d77ee36 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c +++ b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c @@ -1,4 +1,4 @@ -#include "gfx.h" +#include "../../../gfx.h" #include "stm32f746g_discovery_sdram.h" #include "stm32f7xx_hal_rcc.h" #include "stm32f7xx_hal_dma.h" diff --git a/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c b/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c index 6345840c..1ea7450a 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c +++ b/boards/base/STM32F746-Discovery/stm32f746g_raw32_system.c @@ -1,4 +1,4 @@ -#include "gfx.h" +#include "../../../gfx.h" #include "stm32f7xx.h" #if !defined (HSE_VALUE) diff --git a/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c b/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c index de499f3a..aaf3c391 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c +++ b/boards/base/STM32F746-Discovery/stm32f746g_raw32_ugfx.c @@ -1,4 +1,4 @@ -#include "gfx.h" +#include "../../../gfx.h" #include "stm32f7xx_hal.h" #if GFX_USE_OS_CHIBIOS diff --git a/drivers/gadc/AT91SAM7/driver.mk b/drivers/gadc/AT91SAM7/driver.mk index 001d44b1..5a64d7c7 100644 --- a/drivers/gadc/AT91SAM7/driver.mk +++ b/drivers/gadc/AT91SAM7/driver.mk @@ -1,5 +1,2 @@ -# List the required driver. -GFXSRC += $(GFXLIB)/drivers/gadc/AT91SAM7/gadc_lld.c - -# Required include directories GFXINC += $(GFXLIB)/drivers/gadc/AT91SAM7 +GFXSRC += $(GFXLIB)/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c diff --git a/drivers/gadc/AT91SAM7/gadc_lld.c b/drivers/gadc/AT91SAM7/gadc_lld.c deleted file mode 100644 index fa1870b0..00000000 --- a/drivers/gadc/AT91SAM7/gadc_lld.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 drivers/gadc/AT91SAM7/gadc_lld.c - * @brief GADC - Periodic ADC driver source file for the AT91SAM7 cpu. - */ - -#include "gfx.h" - -#if GFX_USE_GADC - -#include "src/gadc/gadc_driver.h" - -static uint32_t nextfreq; - -// Forward references to ISR routines -static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n); -static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err); - -static ADCConversionGroup acg = { - FALSE, // circular - 1, // num_channels - ISR_CompleteI, // end_cb - ISR_ErrorI, // error_cb - 0, // channelselects - 0, // trigger - 0, // frequency - }; - -static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n) { - (void) adcp; - (void) buffer; - - gadcGotDataI(n); -} - -static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err) { - (void) adcp; - (void) err; - - gadcGotDataI(0); -} - -void gadc_lld_init(void) { - adcStart(&ADCD1, 0); -} - -size_t gadc_lld_samplesperconversion(uint32_t physdev) { - size_t samples; - - for(samples = 0; physdev; physdev >>= 1) - if (physdev & 0x01) - samples++; - return samples; -} - -void gadc_lld_start_timerI(uint32_t frequency) { - // Nothing to do here - the AT91SAM7 adc driver uses an internal timer - // which is set up when the job is started. We save this here just to - // indicate the timer should be re-initialised on the next timer job - nextfreq = frequency; -} - -void gadc_lld_stop_timerI(void) { - // Nothing to do here. The AT91SAM7 adc driver automatically turns off timer interrupts - // on completion of the job -} - -void gadc_lld_timerjobI(GadcTimerJob *pj) { - acg.channelselects = pj->physdev; - acg.trigger = ADC_TRIGGER_TIMER; - acg.frequency = nextfreq; - nextfreq = 0; // Next job use the same timer - adcStartConversionI(&ADCD1, &acg, pj->buffer, pj->todo); -} - -void gadc_lld_nontimerjobI(GadcNonTimerJob *pj) { - acg.channelselects = pj->physdev; - acg.trigger = ADC_TRIGGER_SOFTWARE; - adcStartConversionI(&ADCD1, &acg, pj->buffer, 1); -} - -#endif /* GFX_USE_GADC */ diff --git a/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c b/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c new file mode 100644 index 00000000..b061db50 --- /dev/null +++ b/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c @@ -0,0 +1,88 @@ +/* + * 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 drivers/gadc/AT91SAM7/gadc_lld.c + * @brief GADC - Periodic ADC driver source file for the AT91SAM7 cpu. + */ + +#include "gfx.h" + +#if GFX_USE_GADC + +#include "../../../src/gadc/gadc_driver.h" + +static uint32_t nextfreq; + +// Forward references to ISR routines +static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n); +static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err); + +static ADCConversionGroup acg = { + FALSE, // circular + 1, // num_channels + ISR_CompleteI, // end_cb + ISR_ErrorI, // error_cb + 0, // channelselects + 0, // trigger + 0, // frequency + }; + +static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n) { + (void) adcp; + (void) buffer; + + gadcGotDataI(n); +} + +static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err) { + (void) adcp; + (void) err; + + gadcGotDataI(0); +} + +void gadc_lld_init(void) { + adcStart(&ADCD1, 0); +} + +size_t gadc_lld_samplesperconversion(uint32_t physdev) { + size_t samples; + + for(samples = 0; physdev; physdev >>= 1) + if (physdev & 0x01) + samples++; + return samples; +} + +void gadc_lld_start_timerI(uint32_t frequency) { + // Nothing to do here - the AT91SAM7 adc driver uses an internal timer + // which is set up when the job is started. We save this here just to + // indicate the timer should be re-initialised on the next timer job + nextfreq = frequency; +} + +void gadc_lld_stop_timerI(void) { + // Nothing to do here. The AT91SAM7 adc driver automatically turns off timer interrupts + // on completion of the job +} + +void gadc_lld_timerjobI(GadcTimerJob *pj) { + acg.channelselects = pj->physdev; + acg.trigger = ADC_TRIGGER_TIMER; + acg.frequency = nextfreq; + nextfreq = 0; // Next job use the same timer + adcStartConversionI(&ADCD1, &acg, pj->buffer, pj->todo); +} + +void gadc_lld_nontimerjobI(GadcNonTimerJob *pj) { + acg.channelselects = pj->physdev; + acg.trigger = ADC_TRIGGER_SOFTWARE; + adcStartConversionI(&ADCD1, &acg, pj->buffer, 1); +} + +#endif /* GFX_USE_GADC */ diff --git a/drivers/gaudio/Win32/driver.mk b/drivers/gaudio/Win32/driver.mk index f959279f..aa3ed3ab 100644 --- a/drivers/gaudio/Win32/driver.mk +++ b/drivers/gaudio/Win32/driver.mk @@ -1,6 +1,4 @@ -# List the required driver. -GFXSRC += $(GFXLIB)/drivers/gaudio/Win32/gaudio_record_lld.c \ - $(GFXLIB)/drivers/gaudio/Win32/gaudio_play_lld.c - GFXINC += $(GFXLIB)/drivers/gaudio/Win32 +GFXSRC += $(GFXLIB)/drivers/gaudio/Win32/gaudio_record_Win32.c \ + $(GFXLIB)/drivers/gaudio/Win32/gaudio_play_Win32.c GFXLIBS += winmm diff --git a/drivers/gaudio/Win32/gaudio_play_Win32.c b/drivers/gaudio/Win32/gaudio_play_Win32.c new file mode 100644 index 00000000..baafd4ce --- /dev/null +++ b/drivers/gaudio/Win32/gaudio_play_Win32.c @@ -0,0 +1,183 @@ +/* + * 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 + */ + +// We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts +#define GFILE_NEED_STDIO_MUST_BE_OFF + +#include "gfx.h" + +#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY + +/* Include the driver defines */ +#include "../../../src/gaudio/gaudio_driver_play.h" + +#undef Red +#undef Green +#undef Blue +#define WIN32_LEAN_AND_MEAN +#include +#include +#include + +#define MAX_WAVE_HEADERS 2 // Larger numbers enable more buffering which is good for ensuring + // there are no skips due to data not being available, however larger + // numbers of buffers also create higher latency. + +static HWAVEOUT ah = 0; +static volatile int nQueuedBuffers; +static bool_t isRunning; +static WAVEHDR WaveHdrs[MAX_WAVE_HEADERS]; +static HANDLE waveThread; +static DWORD threadID; + +/**************************** waveProc() ******************************* + * We don't use CALLBACK_FUNCTION because it is restricted to calling only + * a few particular Windows functions, namely some of the time functions, + * and a few of the Low Level MIDI API. If you violate this rule, your app can + * hang inside of the callback). One of the Windows API that a callback can't + * call is waveOutUnPrepareBuffer() which is what we need to use whenever we receive a + * MM_WOM_DONE. My callback would need to defer that job to another thread + * anyway, so instead just use CALLBACK_THREAD here instead. + *************************************************************************/ + +static bool_t senddata(WAVEHDR *pwh) { + GDataBuffer *paud; + + // Get the next data block to send + gfxSystemLock(); + paud = gaudioPlayGetDataBlockI(); + if (!paud && !nQueuedBuffers) + gaudioPlayDoneI(); + gfxSystemUnlock(); + if (!paud) + return FALSE; + + // Prepare the wave header for Windows + pwh->dwUser = (DWORD_PTR)paud; + pwh->lpData = (LPSTR)(paud+1); // The data is on the end of the structure + pwh->dwBufferLength = paud->len; + pwh->dwFlags = 0; + pwh->dwLoops = 0; + if (waveOutPrepareHeader(ah, pwh, sizeof(WAVEHDR))) { + fprintf(stderr, "GAUDIO: Failed to prepare a play buffer"); + exit(-1); + } + + // Send it to windows + if (waveOutWrite(ah, pwh, sizeof(WAVEHDR))) { + fprintf(stderr, "GAUDIO: Failed to write the play buffer"); + exit(-1); + } + + nQueuedBuffers++; + return TRUE; +} + +static DWORD WINAPI waveProc(LPVOID arg) { + MSG msg; + WAVEHDR *pwh; + (void) arg; + + while (GetMessage(&msg, 0, 0, 0)) { + switch (msg.message) { + case MM_WOM_DONE: + pwh = (WAVEHDR *)msg.lParam; + + // Windows - Let go! + waveOutUnprepareHeader(ah, pwh, sizeof(WAVEHDR)); + + // Give the buffer back to the Audio Free List + gfxSystemLock(); + gaudioPlayReleaseDataBlockI((GDataBuffer *)pwh->dwUser); + gfxSystemUnlock(); + pwh->lpData = 0; + nQueuedBuffers--; + + // Are we stopping? + if (!isRunning) { + // Have we finished yet? + if (!nQueuedBuffers) { + gfxSystemLock(); + gaudioPlayDoneI(); + gfxSystemUnlock(); + } + break; + } + + // Try and get a new block + senddata(pwh); + break; + } + } + return 0; +} + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + WAVEFORMATEX wfx; + + if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) + return FALSE; + + if (!waveThread) { + if (!(waveThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)waveProc, 0, 0, &threadID))) { + fprintf(stderr, "GAUDIO: Can't create WAVE play-back thread\n"); + exit(-1); + } + CloseHandle(waveThread); + } + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nChannels = channel == GAUDIO_PLAY_STEREO ? 2 : 1; + wfx.nSamplesPerSec = frequency; + wfx.nBlockAlign = wfx.nChannels * (format == ARRAY_DATA_8BITUNSIGNED ? 1 : 2); + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + wfx.wBitsPerSample = (format == ARRAY_DATA_8BITUNSIGNED ? 8 : 16); + wfx.cbSize = 0; + + if (ah) { + waveOutClose(ah); + ah = 0; + } + if (waveOutOpen(&ah, WAVE_MAPPER, &wfx, (DWORD_PTR)threadID, 0, CALLBACK_THREAD)) { + fprintf(stderr, "GAUDIO: Can't open WAVE play-back device\n"); + exit(-1); + } + + return TRUE; +} + +bool_t gaudio_play_lld_set_volume(uint8_t vol) { + if (!ah) + return FALSE; + return waveOutSetVolume(ah, (((uint16_t)vol)<<8)|vol) != 0; +} + +void gaudio_play_lld_start(void) { + WAVEHDR *pwh; + + isRunning = TRUE; + while (nQueuedBuffers < MAX_WAVE_HEADERS) { + // Find the empty one - there will always be at least one. + for(pwh = WaveHdrs; pwh->lpData; pwh++); + + // Grab the next audio block from the Audio Out Queue + if (!senddata(pwh)) + break; + } +} + +void gaudio_play_lld_stop(void) { + isRunning = FALSE; + waveOutReset(ah); + while(nQueuedBuffers) Sleep(1); +} + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gaudio/Win32/gaudio_play_lld.c b/drivers/gaudio/Win32/gaudio_play_lld.c deleted file mode 100644 index 03d9acea..00000000 --- a/drivers/gaudio/Win32/gaudio_play_lld.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * 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 - */ - -// We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts -#define GFILE_NEED_STDIO_MUST_BE_OFF - -#include "gfx.h" - -#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY - -/* Include the driver defines */ -#include "src/gaudio/gaudio_driver_play.h" - -#undef Red -#undef Green -#undef Blue -#define WIN32_LEAN_AND_MEAN -#include -#include -#include - -#define MAX_WAVE_HEADERS 2 // Larger numbers enable more buffering which is good for ensuring - // there are no skips due to data not being available, however larger - // numbers of buffers also create higher latency. - -static HWAVEOUT ah = 0; -static volatile int nQueuedBuffers; -static bool_t isRunning; -static WAVEHDR WaveHdrs[MAX_WAVE_HEADERS]; -static HANDLE waveThread; -static DWORD threadID; - -/**************************** waveProc() ******************************* - * We don't use CALLBACK_FUNCTION because it is restricted to calling only - * a few particular Windows functions, namely some of the time functions, - * and a few of the Low Level MIDI API. If you violate this rule, your app can - * hang inside of the callback). One of the Windows API that a callback can't - * call is waveOutUnPrepareBuffer() which is what we need to use whenever we receive a - * MM_WOM_DONE. My callback would need to defer that job to another thread - * anyway, so instead just use CALLBACK_THREAD here instead. - *************************************************************************/ - -static bool_t senddata(WAVEHDR *pwh) { - GDataBuffer *paud; - - // Get the next data block to send - gfxSystemLock(); - paud = gaudioPlayGetDataBlockI(); - if (!paud && !nQueuedBuffers) - gaudioPlayDoneI(); - gfxSystemUnlock(); - if (!paud) - return FALSE; - - // Prepare the wave header for Windows - pwh->dwUser = (DWORD_PTR)paud; - pwh->lpData = (LPSTR)(paud+1); // The data is on the end of the structure - pwh->dwBufferLength = paud->len; - pwh->dwFlags = 0; - pwh->dwLoops = 0; - if (waveOutPrepareHeader(ah, pwh, sizeof(WAVEHDR))) { - fprintf(stderr, "GAUDIO: Failed to prepare a play buffer"); - exit(-1); - } - - // Send it to windows - if (waveOutWrite(ah, pwh, sizeof(WAVEHDR))) { - fprintf(stderr, "GAUDIO: Failed to write the play buffer"); - exit(-1); - } - - nQueuedBuffers++; - return TRUE; -} - -static DWORD WINAPI waveProc(LPVOID arg) { - MSG msg; - WAVEHDR *pwh; - (void) arg; - - while (GetMessage(&msg, 0, 0, 0)) { - switch (msg.message) { - case MM_WOM_DONE: - pwh = (WAVEHDR *)msg.lParam; - - // Windows - Let go! - waveOutUnprepareHeader(ah, pwh, sizeof(WAVEHDR)); - - // Give the buffer back to the Audio Free List - gfxSystemLock(); - gaudioPlayReleaseDataBlockI((GDataBuffer *)pwh->dwUser); - gfxSystemUnlock(); - pwh->lpData = 0; - nQueuedBuffers--; - - // Are we stopping? - if (!isRunning) { - // Have we finished yet? - if (!nQueuedBuffers) { - gfxSystemLock(); - gaudioPlayDoneI(); - gfxSystemUnlock(); - } - break; - } - - // Try and get a new block - senddata(pwh); - break; - } - } - return 0; -} - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { - WAVEFORMATEX wfx; - - if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) - return FALSE; - - if (!waveThread) { - if (!(waveThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)waveProc, 0, 0, &threadID))) { - fprintf(stderr, "GAUDIO: Can't create WAVE play-back thread\n"); - exit(-1); - } - CloseHandle(waveThread); - } - - wfx.wFormatTag = WAVE_FORMAT_PCM; - wfx.nChannels = channel == GAUDIO_PLAY_STEREO ? 2 : 1; - wfx.nSamplesPerSec = frequency; - wfx.nBlockAlign = wfx.nChannels * (format == ARRAY_DATA_8BITUNSIGNED ? 1 : 2); - wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; - wfx.wBitsPerSample = (format == ARRAY_DATA_8BITUNSIGNED ? 8 : 16); - wfx.cbSize = 0; - - if (ah) { - waveOutClose(ah); - ah = 0; - } - if (waveOutOpen(&ah, WAVE_MAPPER, &wfx, (DWORD_PTR)threadID, 0, CALLBACK_THREAD)) { - fprintf(stderr, "GAUDIO: Can't open WAVE play-back device\n"); - exit(-1); - } - - return TRUE; -} - -bool_t gaudio_play_lld_set_volume(uint8_t vol) { - if (!ah) - return FALSE; - return waveOutSetVolume(ah, (((uint16_t)vol)<<8)|vol) != 0; -} - -void gaudio_play_lld_start(void) { - WAVEHDR *pwh; - - isRunning = TRUE; - while (nQueuedBuffers < MAX_WAVE_HEADERS) { - // Find the empty one - there will always be at least one. - for(pwh = WaveHdrs; pwh->lpData; pwh++); - - // Grab the next audio block from the Audio Out Queue - if (!senddata(pwh)) - break; - } -} - -void gaudio_play_lld_stop(void) { - isRunning = FALSE; - waveOutReset(ah); - while(nQueuedBuffers) Sleep(1); -} - -#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gaudio/Win32/gaudio_record_Win32.c b/drivers/gaudio/Win32/gaudio_record_Win32.c new file mode 100644 index 00000000..e3e122d8 --- /dev/null +++ b/drivers/gaudio/Win32/gaudio_record_Win32.c @@ -0,0 +1,185 @@ +/* + * 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 + */ + +// We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts +#define GFILE_NEED_STDIO_MUST_BE_OFF + +#include "gfx.h" + +#if GFX_USE_GAUDIO && GAUDIO_NEED_RECORD + +/* Include the driver defines */ +#include "../../../src/gaudio/gaudio_driver_record.h" + +#undef Red +#undef Green +#undef Blue +#define WIN32_LEAN_AND_MEAN +#include +#include +#include + +#define MAX_WAVE_HEADERS 2 // Larger numbers enable more buffering which is good for ensuring + // there are no skips due to data not being available, however larger + // numbers of buffers chews buffers on the free-list. + +static HWAVEIN ah = 0; +static volatile int nQueuedBuffers; +static bool_t isRunning; +static WAVEHDR WaveHdrs[MAX_WAVE_HEADERS]; +static HANDLE waveThread; +static DWORD threadID; + +/**************************** waveProc() ******************************* + * We don't use CALLBACK_FUNCTION because it is restricted to calling only + * a few particular Windows functions, namely some of the time functions, + * and a few of the Low Level MIDI API. If you violate this rule, your app can + * hang inside of the callback). One of the Windows API that a callback can't + * call is waveInAddBuffer() which is what we need to use whenever we receive a + * MM_WIM_DATA. My callback would need to defer that job to another thread + * anyway, so instead just use CALLBACK_THREAD here instead. + *************************************************************************/ + +static bool_t getbuffer(WAVEHDR *pwh) { + GDataBuffer *paud; + + // Get the next data block to send + gfxSystemLock(); + paud = gaudioRecordGetFreeBlockI(); + if (!paud && !nQueuedBuffers) + gaudioRecordDoneI(); + gfxSystemUnlock(); + if (!paud) + return FALSE; + + // Prepare the wave header for Windows + pwh->dwUser = (DWORD_PTR)paud; + pwh->lpData = (LPSTR)(paud+1); // The data is on the end of the structure + pwh->dwBufferLength = paud->size; + pwh->dwFlags = 0; + if (waveInPrepareHeader(ah, pwh, sizeof(WAVEHDR))) { + fprintf(stderr, "GAUDIO: Failed to prepare a record buffer"); + exit(-1); + } + + // Send it to windows + if (waveInAddBuffer(ah, pwh, sizeof(WAVEHDR))) { + fprintf(stderr, "GAUDIO: Failed to add the record buffer"); + exit(-1); + } + + nQueuedBuffers++; + return TRUE; +} + +static DWORD WINAPI waveProc(LPVOID arg) { + MSG msg; + WAVEHDR *pwh; + GDataBuffer *paud; + (void) arg; + + while (GetMessage(&msg, 0, 0, 0)) { + switch (msg.message) { + case MM_WIM_DATA: + pwh = (WAVEHDR *)msg.lParam; + + // Windows - Let go! + waveInUnprepareHeader(ah, pwh, sizeof(WAVEHDR)); + + // Save the buffer in the audio record list + paud = (GDataBuffer *)pwh->dwUser; + paud->len = pwh->dwBytesRecorded; + gfxSystemLock(); + gaudioRecordSaveDataBlockI(paud); + gfxSystemUnlock(); + pwh->lpData = 0; + nQueuedBuffers--; + + // Are we stopping? + if (!isRunning) { + // Have we finished yet? + if (!nQueuedBuffers) { + gfxSystemLock(); + gaudioRecordDoneI(); + gfxSystemUnlock(); + } + break; + } + + // Try and get a new block + getbuffer(pwh); + break; + } + } + return 0; +} + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +bool_t gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + WAVEFORMATEX wfx; + + if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) + return FALSE; + + if (!waveThread) { + if (!(waveThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)waveProc, 0, 0, &threadID))) { + fprintf(stderr, "GAUDIO: Can't create WAVE recording thread\n"); + exit(-1); + } + CloseHandle(waveThread); + } + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nChannels = channel == GAUDIO_RECORD_STEREO ? 2 : 1; + wfx.nSamplesPerSec = frequency; + wfx.nBlockAlign = wfx.nChannels * (format == ARRAY_DATA_8BITUNSIGNED ? 1 : 2); + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + wfx.wBitsPerSample = (format == ARRAY_DATA_8BITUNSIGNED ? 8 : 16); + wfx.cbSize = 0; + + if (ah) { + waveInClose(ah); + ah = 0; + } + if (waveInOpen(&ah, WAVE_MAPPER, &wfx, (DWORD_PTR)threadID, 0, CALLBACK_THREAD)) { + fprintf(stderr, "GAUDIN: Can't open WAVE recording device\n"); + exit(-1); + } + + return TRUE; +} + +void gaudio_record_lld_start(void) { + WAVEHDR *pwh; + + if (!ah) + return; + + while (nQueuedBuffers < MAX_WAVE_HEADERS) { + // Find the empty one - there will always be at least one. + for(pwh = WaveHdrs; pwh->lpData; pwh++); + + // Grab the next audio block from the free-list + if (!getbuffer(pwh)) + break; + } + if (!isRunning) { + isRunning = TRUE; + waveInStart(ah); + } +} + +void gaudio_record_lld_stop(void) { + isRunning = FALSE; + waveInReset(ah); + while(nQueuedBuffers) Sleep(1); +} + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */ diff --git a/drivers/gaudio/Win32/gaudio_record_lld.c b/drivers/gaudio/Win32/gaudio_record_lld.c deleted file mode 100644 index dd1a201a..00000000 --- a/drivers/gaudio/Win32/gaudio_record_lld.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * 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 - */ - -// We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts -#define GFILE_NEED_STDIO_MUST_BE_OFF - -#include "gfx.h" - -#if GFX_USE_GAUDIO && GAUDIO_NEED_RECORD - -/* Include the driver defines */ -#include "src/gaudio/gaudio_driver_record.h" - -#undef Red -#undef Green -#undef Blue -#define WIN32_LEAN_AND_MEAN -#include -#include -#include - -#define MAX_WAVE_HEADERS 2 // Larger numbers enable more buffering which is good for ensuring - // there are no skips due to data not being available, however larger - // numbers of buffers chews buffers on the free-list. - -static HWAVEIN ah = 0; -static volatile int nQueuedBuffers; -static bool_t isRunning; -static WAVEHDR WaveHdrs[MAX_WAVE_HEADERS]; -static HANDLE waveThread; -static DWORD threadID; - -/**************************** waveProc() ******************************* - * We don't use CALLBACK_FUNCTION because it is restricted to calling only - * a few particular Windows functions, namely some of the time functions, - * and a few of the Low Level MIDI API. If you violate this rule, your app can - * hang inside of the callback). One of the Windows API that a callback can't - * call is waveInAddBuffer() which is what we need to use whenever we receive a - * MM_WIM_DATA. My callback would need to defer that job to another thread - * anyway, so instead just use CALLBACK_THREAD here instead. - *************************************************************************/ - -static bool_t getbuffer(WAVEHDR *pwh) { - GDataBuffer *paud; - - // Get the next data block to send - gfxSystemLock(); - paud = gaudioRecordGetFreeBlockI(); - if (!paud && !nQueuedBuffers) - gaudioRecordDoneI(); - gfxSystemUnlock(); - if (!paud) - return FALSE; - - // Prepare the wave header for Windows - pwh->dwUser = (DWORD_PTR)paud; - pwh->lpData = (LPSTR)(paud+1); // The data is on the end of the structure - pwh->dwBufferLength = paud->size; - pwh->dwFlags = 0; - if (waveInPrepareHeader(ah, pwh, sizeof(WAVEHDR))) { - fprintf(stderr, "GAUDIO: Failed to prepare a record buffer"); - exit(-1); - } - - // Send it to windows - if (waveInAddBuffer(ah, pwh, sizeof(WAVEHDR))) { - fprintf(stderr, "GAUDIO: Failed to add the record buffer"); - exit(-1); - } - - nQueuedBuffers++; - return TRUE; -} - -static DWORD WINAPI waveProc(LPVOID arg) { - MSG msg; - WAVEHDR *pwh; - GDataBuffer *paud; - (void) arg; - - while (GetMessage(&msg, 0, 0, 0)) { - switch (msg.message) { - case MM_WIM_DATA: - pwh = (WAVEHDR *)msg.lParam; - - // Windows - Let go! - waveInUnprepareHeader(ah, pwh, sizeof(WAVEHDR)); - - // Save the buffer in the audio record list - paud = (GDataBuffer *)pwh->dwUser; - paud->len = pwh->dwBytesRecorded; - gfxSystemLock(); - gaudioRecordSaveDataBlockI(paud); - gfxSystemUnlock(); - pwh->lpData = 0; - nQueuedBuffers--; - - // Are we stopping? - if (!isRunning) { - // Have we finished yet? - if (!nQueuedBuffers) { - gfxSystemLock(); - gaudioRecordDoneI(); - gfxSystemUnlock(); - } - break; - } - - // Try and get a new block - getbuffer(pwh); - break; - } - } - return 0; -} - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -bool_t gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { - WAVEFORMATEX wfx; - - if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) - return FALSE; - - if (!waveThread) { - if (!(waveThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)waveProc, 0, 0, &threadID))) { - fprintf(stderr, "GAUDIO: Can't create WAVE recording thread\n"); - exit(-1); - } - CloseHandle(waveThread); - } - - wfx.wFormatTag = WAVE_FORMAT_PCM; - wfx.nChannels = channel == GAUDIO_RECORD_STEREO ? 2 : 1; - wfx.nSamplesPerSec = frequency; - wfx.nBlockAlign = wfx.nChannels * (format == ARRAY_DATA_8BITUNSIGNED ? 1 : 2); - wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; - wfx.wBitsPerSample = (format == ARRAY_DATA_8BITUNSIGNED ? 8 : 16); - wfx.cbSize = 0; - - if (ah) { - waveInClose(ah); - ah = 0; - } - if (waveInOpen(&ah, WAVE_MAPPER, &wfx, (DWORD_PTR)threadID, 0, CALLBACK_THREAD)) { - fprintf(stderr, "GAUDIN: Can't open WAVE recording device\n"); - exit(-1); - } - - return TRUE; -} - -void gaudio_record_lld_start(void) { - WAVEHDR *pwh; - - if (!ah) - return; - - while (nQueuedBuffers < MAX_WAVE_HEADERS) { - // Find the empty one - there will always be at least one. - for(pwh = WaveHdrs; pwh->lpData; pwh++); - - // Grab the next audio block from the free-list - if (!getbuffer(pwh)) - break; - } - if (!isRunning) { - isRunning = TRUE; - waveInStart(ah); - } -} - -void gaudio_record_lld_stop(void) { - isRunning = FALSE; - waveInReset(ah); - while(nQueuedBuffers) Sleep(1); -} - -#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */ diff --git a/drivers/gaudio/gadc/driver.mk b/drivers/gaudio/gadc/driver.mk index b5a2768a..f9d2db03 100644 --- a/drivers/gaudio/gadc/driver.mk +++ b/drivers/gaudio/gadc/driver.mk @@ -1,8 +1,5 @@ -# List the required driver. -GFXSRC += $(GFXLIB)/drivers/gaudio/gadc/gaudio_record_lld.c - -# Required include directories GFXINC += $(GFXLIB)/drivers/gaudio/gadc +GFXSRC += $(GFXLIB)/drivers/gaudio/gadc/gaudio_record_gadc.c # Make sure the GADC sub-system is turned on GFXDEFS += -DGFX_USE_GADC=GAUDIO_NEED_RECORD diff --git a/drivers/gaudio/gadc/gaudio_record_gadc.c b/drivers/gaudio/gadc/gaudio_record_gadc.c new file mode 100644 index 00000000..a35d070b --- /dev/null +++ b/drivers/gaudio/gadc/gaudio_record_gadc.c @@ -0,0 +1,55 @@ +/* + * 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 + */ + +#define GAUDIO_RECORD_IMPLEMENTATION +#include "gfx.h" + +#if GFX_USE_GAUDIO && GAUDIO_NEED_RECORD + +/* Double check the GADC system is turned on */ +#if !GFX_USE_GADC + #error "GAUDIO - The GADC driver for GAUDIO requires GFX_USE_GADC to be TRUE" +#endif + +/* Include the driver defines */ +#include "../../../src/gaudio/gaudio_driver_record.h" + +static void gadcCallbackI(void) { + GDataBuffer *pd; + + pd = gadcHighSpeedGetDataI(); + if (pd) + gaudioRecordSaveDataBlockI(pd); +} + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +bool_t gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + /* Check the parameters */ + if (channel >= GAUDIO_RECORD_NUM_CHANNELS || frequency > GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY || format != GAUDIO_RECORD_FORMAT1) + return FALSE; + + /* Setup the high speed GADC */ + gadcHighSpeedInit(gaudio_gadc_physdevs[channel], frequency); + + /* Register ourselves for ISR callbacks */ + gadcHighSpeedSetISRCallback(gadcCallbackI); + + return TRUE; +} + +void gaudio_record_lld_start(void) { + gadcHighSpeedStart(); +} + +void gaudio_record_lld_stop(void) { + gadcHighSpeedStop(); +} + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */ diff --git a/drivers/gaudio/gadc/gaudio_record_lld.c b/drivers/gaudio/gadc/gaudio_record_lld.c deleted file mode 100644 index 6495309a..00000000 --- a/drivers/gaudio/gadc/gaudio_record_lld.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 - */ - -#define GAUDIO_RECORD_IMPLEMENTATION -#include "gfx.h" - -#if GFX_USE_GAUDIO && GAUDIO_NEED_RECORD - -/* Double check the GADC system is turned on */ -#if !GFX_USE_GADC - #error "GAUDIO - The GADC driver for GAUDIO requires GFX_USE_GADC to be TRUE" -#endif - -/* Include the driver defines */ -#include "src/gaudio/gaudio_driver_record.h" - -static void gadcCallbackI(void) { - GDataBuffer *pd; - - pd = gadcHighSpeedGetDataI(); - if (pd) - gaudioRecordSaveDataBlockI(pd); -} - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -bool_t gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { - /* Check the parameters */ - if (channel >= GAUDIO_RECORD_NUM_CHANNELS || frequency > GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY || format != GAUDIO_RECORD_FORMAT1) - return FALSE; - - /* Setup the high speed GADC */ - gadcHighSpeedInit(gaudio_gadc_physdevs[channel], frequency); - - /* Register ourselves for ISR callbacks */ - gadcHighSpeedSetISRCallback(gadcCallbackI); - - return TRUE; -} - -void gaudio_record_lld_start(void) { - gadcHighSpeedStart(); -} - -void gaudio_record_lld_stop(void) { - gadcHighSpeedStop(); -} - -#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */ diff --git a/drivers/gaudio/pwm/driver.mk b/drivers/gaudio/pwm/driver.mk index 52f752aa..32f74c28 100644 --- a/drivers/gaudio/pwm/driver.mk +++ b/drivers/gaudio/pwm/driver.mk @@ -1,5 +1,2 @@ -# List the required driver. -GFXSRC += $(GFXLIB)/drivers/gaudio/pwm/gaudio_play_lld.c - -# Required include directories GFXINC += $(GFXLIB)/drivers/gaudio/pwm +GFXSRC += $(GFXLIB)/drivers/gaudio/pwm/gaudio_play_pwm.c diff --git a/drivers/gaudio/pwm/gaudio_play_lld.c b/drivers/gaudio/pwm/gaudio_play_lld.c deleted file mode 100644 index d4d85c33..00000000 --- a/drivers/gaudio/pwm/gaudio_play_lld.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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 - */ - -#include "gfx.h" - -#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY - -/* Include the driver defines */ -#include "src/gaudio/gaudio_driver_play.h" - -/* Forward definition */ -static void gaudio_play_pwm_timer_callbackI(void); - -/* Include the board interface */ -#include "gaudio_play_board.h" - -static GDataBuffer *pplay; -static ArrayDataFormat playfmt; -static size_t playlen; -static uint8_t *pdata; - -static void gaudio_play_pwm_timer_callbackI(void) { - if (pplay) { - - // Get the next value from the current data buffer - if (gfxSampleFormatBits(playfmt) > 8) { - gaudio_play_pwm_setI(*(uint16_t *)pdata); - pdata += 2; - } else { - gaudio_play_pwm_setI(*pdata); - pdata++; - } - - // Are we done yet - if (--playlen) - return; - gaudioPlayReleaseDataBlockI(pplay); - - // Get a new data buffer - if (!(pplay = gaudioPlayGetDataBlockI())) { - // All is done - gaudioPlayDoneI(); - return; - } - - } else { - // Get a new data buffer - if (!(pplay = gaudioPlayGetDataBlockI())) - return; - } - - // Set up ready for the new buffer - playlen = pplay->len; - if (gfxSampleFormatBits(playfmt) > 8) - playlen >>= 1; - pdata = (uint8_t *)(pplay+1); -} - - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { - (void) channel; - - if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_10BITUNSIGNED) - return FALSE; - - playfmt = format; - return gaudio_play_pwm_setup(frequency, format); -} - -bool_t gaudio_play_lld_set_volume(uint8_t vol) { - (void) vol; - return FALSE; -} - -void gaudio_play_lld_start(void) { - - gfxSystemLock(); - // Get a new data buffer - if (pplay || !(pplay = gaudioPlayGetDataBlockI())) { - gfxSystemUnlock(); // Nothing to do - return; - } - - // Set up ready for the new buffer - playlen = pplay->len; - if (gfxSampleFormatBits(playfmt) > 8) - playlen >>= 1; - pdata = (uint8_t *)(pplay+1); - gfxSystemUnlock(); - - // Start the playing - gaudio_play_pwm_start(); -} - -void gaudio_play_lld_stop(void) { - // Stop everything - gaudio_play_pwm_stop(); - - // We may need to clean up the remaining buffer. - gfxSystemLock(); - if (pplay) { - gaudioPlayReleaseDataBlockI(pplay); - pplay = 0; - gaudioPlayDoneI(); - } - gfxSystemUnlock(); -} - -#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gaudio/pwm/gaudio_play_pwm.c b/drivers/gaudio/pwm/gaudio_play_pwm.c new file mode 100644 index 00000000..91d7a835 --- /dev/null +++ b/drivers/gaudio/pwm/gaudio_play_pwm.c @@ -0,0 +1,117 @@ +/* + * 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 + */ + +#include "gfx.h" + +#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY + +/* Include the driver defines */ +#include "../../../src/gaudio/gaudio_driver_play.h" + +/* Forward definition */ +static void gaudio_play_pwm_timer_callbackI(void); + +/* Include the board interface */ +#include "gaudio_play_board.h" + +static GDataBuffer *pplay; +static ArrayDataFormat playfmt; +static size_t playlen; +static uint8_t *pdata; + +static void gaudio_play_pwm_timer_callbackI(void) { + if (pplay) { + + // Get the next value from the current data buffer + if (gfxSampleFormatBits(playfmt) > 8) { + gaudio_play_pwm_setI(*(uint16_t *)pdata); + pdata += 2; + } else { + gaudio_play_pwm_setI(*pdata); + pdata++; + } + + // Are we done yet + if (--playlen) + return; + gaudioPlayReleaseDataBlockI(pplay); + + // Get a new data buffer + if (!(pplay = gaudioPlayGetDataBlockI())) { + // All is done + gaudioPlayDoneI(); + return; + } + + } else { + // Get a new data buffer + if (!(pplay = gaudioPlayGetDataBlockI())) + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + if (gfxSampleFormatBits(playfmt) > 8) + playlen >>= 1; + pdata = (uint8_t *)(pplay+1); +} + + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + (void) channel; + + if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_10BITUNSIGNED) + return FALSE; + + playfmt = format; + return gaudio_play_pwm_setup(frequency, format); +} + +bool_t gaudio_play_lld_set_volume(uint8_t vol) { + (void) vol; + return FALSE; +} + +void gaudio_play_lld_start(void) { + + gfxSystemLock(); + // Get a new data buffer + if (pplay || !(pplay = gaudioPlayGetDataBlockI())) { + gfxSystemUnlock(); // Nothing to do + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + if (gfxSampleFormatBits(playfmt) > 8) + playlen >>= 1; + pdata = (uint8_t *)(pplay+1); + gfxSystemUnlock(); + + // Start the playing + gaudio_play_pwm_start(); +} + +void gaudio_play_lld_stop(void) { + // Stop everything + gaudio_play_pwm_stop(); + + // We may need to clean up the remaining buffer. + gfxSystemLock(); + if (pplay) { + gaudioPlayReleaseDataBlockI(pplay); + pplay = 0; + gaudioPlayDoneI(); + } + gfxSystemUnlock(); +} + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gaudio/vs1053/driver.mk b/drivers/gaudio/vs1053/driver.mk index faf92852..3dfb3b3d 100644 --- a/drivers/gaudio/vs1053/driver.mk +++ b/drivers/gaudio/vs1053/driver.mk @@ -1,7 +1,2 @@ -# List the required driver. -GFXSRC += $(GFXLIB)/drivers/gaudio/vs1053/gaudio_play_lld.c - -# Required include directories GFXINC += $(GFXLIB)/drivers/gaudio/vs1053 - -#GFXDEFS += -DGFX_USE_GTIMER=GFX_USE_GAUDIO +GFXSRC += $(GFXLIB)/drivers/gaudio/vs1053/gaudio_play_vs1053.c diff --git a/drivers/gaudio/vs1053/gaudio_play_lld.c b/drivers/gaudio/vs1053/gaudio_play_lld.c deleted file mode 100644 index 24c5a176..00000000 --- a/drivers/gaudio/vs1053/gaudio_play_lld.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * 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 - */ - -#include "gfx.h" - -#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY - -/* Include the driver defines */ -#include "src/gaudio/gaudio_driver_play.h" - -/* Include the vs1053 registers */ -#include "drivers/gaudio/vs1053/vs1053.h" - -/* Include the board interface */ -#include "gaudio_play_board.h" - -// Override-able parameters -#ifndef VS1053_CLK - #define VS1053_CLK 12288000 -#endif -#ifndef VS1053_FIRMWARE_PATCH - #define VS1053_FIRMWARE_PATCH FALSE -#endif -#ifndef VS1053_POLL_RATE - #define VS1053_POLL_RATE 5 -#endif - -// Load the patch file if desired. New format patches only. -#if VS1053_FIRMWARE_PATCH - #define SKIP_PLUGIN_VARNAME - static const uint16_t plugin[] = { /* Compressed plugin */ - #include "vs1053_patch.plg" - }; -#endif - -// Set various stuff based on the clock -#if VS1053_CLK >= 16192000 - #define SCI_MODE_STARTUP (SCI_MODE_DEFAULTS|SM_CLK_RANGE) - #define VS1053_CLKI (VS1053_CLK/2) -#else - #define SCI_MODE_STARTUP (SCI_MODE_DEFAULTS) - #define VS1053_CLKI (VS1053_CLK) -#endif -#if VS1053_CLKI > 13000000 || VS1053_CLKI < 12000000 - #error "GAUDIO(vs1053): VS1053_CLK is out of range" -#endif -#if VS1053_CLKI == 12288000 - #define SC_FREQ_ADJUST 0x0000 -#else - #define SC_FREQ_ADJUST ((VS1053_CLKI-8000000)/4000) -#endif -#define VS1053_MAX_SAMPLE_RATE (VS1053_CLKI/256) -#if VS1053_CLKI > 1228800 - #define SC_CLOCK_MODE (SC_MULT_3|SC_ADD_1|SC_FREQ_ADJUST) -#else - #define SC_CLOCK_MODE (SC_MULT_3_5|SC_ADD_1|SC_FREQ_ADJUST) -#endif - -// Our static variables -static bool_t vs1053_isinit; -static GTimer playTimer; - -// Some common macro's -#define waitforready() while(!board_dreq()) gfxSleepMilliseconds(5) - -static void cmd_write(uint16_t addr, uint16_t data) { - char buf[4]; - buf[0] = 2; - buf[1] = (char)addr; - buf[2] = (char)(data >> 8); - buf[3] = (char)data; - - waitforready(); - board_startcmdwrite(); - board_spiwrite(buf, 4); - board_endcmdwrite(); -} - -#if VS1053_CLK > 12288000 - static GFXINLINE void cmd_writenodreq(uint16_t addr, uint16_t data) { - uint8_t buf[4]; - - // This is the same as cmd_write() except for it doesn't wait for dreq first - buf[0] = 2; - buf[1] = (uint8_t)addr; - buf[2] = (uint8_t)(data >> 8); - buf[3] = (uint8_t)data; - - board_startcmdwrite(); - board_spiwrite(buf, 4); - board_endcmdwrite(); - } -#endif - -static uint16_t cmd_read(uint16_t addr) { - uint8_t buf[2]; - - buf[0] = 3; - buf[1] = (char)addr; - - board_startcmdread(); - board_spiwrite(buf, 2); - board_spiread(buf, 2); - board_endcmdread(); - return (((uint16_t)buf[0])<<8)|buf[1]; -} - -static void data_write(const uint8_t *data, unsigned len) { - board_startdatawrite(); - board_spiwrite(data, len); - board_enddatawrite(); -} - -#if VS1053_FIRMWARE_PATCH - static void LoadUserCode(void) { - int i; - uint16_t addr, n, val; - - for(i=0; i 12288000 - cmd_writenodreq(SCI_MODE, SCI_MODE_STARTUP); // Set super-clock before dreq - #endif - - // Set up registers - cmd_write(SCI_MODE, SCI_MODE_STARTUP); // Set mode - cmd_write(SCI_CLOCKF, SC_CLOCK_MODE); // Set clocks - board_init_end(); // Clocks are now set up - cmd_write(SCI_BASS, 0x0000); // No treble or bass boost - cmd_write(SCI_VOL, VOL_MAX); // Maximum volume - - // Load any firmware - #if VS1053_FIRMWARE_PATCH - LoadUserCode(); - - // Reset mode just in case - cmd_write(SCI_MODE, SCI_MODE_STARTUP); - #endif -} - -static void vs1053_soft_reset(void) { - cmd_write(SCI_MODE, cmd_read(SCI_MODE)|SM_RESET); - gfxSleepMilliseconds(1); // Wait for at least 2uS - waitforready(); - - // Reload any firmware - #if VS1053_FIRMWARE_PATCH - LoadUserCode(); - - // Reset mode just in case - cmd_write(SCI_MODE, SCI_MODE_STARTUP); - #endif -} - -static uint16_t vs1053_getendbyte(void) { - cmd_write(SCI_WRAMADDR, WRAMADDR_EXTRAPARAMS+4); - return cmd_read(SCI_WRAM); -} - -static GTimer playTimer; -static GDataBuffer *pplay; -static size_t playlen; -static uint8_t *pdata; - -static void FeedData(void *param) { - unsigned len; - (void) param; - - // While there is data space - while (board_dreq()) { - - // Send up to 32 bytes - len = playlen; - if (len > 32) len = 32; - data_write(pdata, len); - pdata += len; - playlen -= len; - - // Have we finished the buffer - while (!playlen) { - gfxSystemLock(); - gaudioPlayReleaseDataBlockI(pplay); - - // Get a new data buffer - if (!(pplay = gaudioPlayGetDataBlockI())) { - // We should really only do the play-done when the audio - // has really finished playing. Unfortunately there seems - // to be no documented way of determining this. - gaudioPlayDoneI(); - gfxSystemUnlock(); - gtimerStop(&playTimer); - return; - } - - // Set up ready for the new buffer - playlen = pplay->len; - pdata = (uint8_t *)(pplay+1); - gfxSystemUnlock(); - } - } -} - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { - uint32_t brate; - uint32_t bps; - uint8_t buf[4]; - static const uint8_t hdr1[] = { - 'R', 'I', 'F', 'F', - 0xFF, 0xFF, 0xFF, 0xFF, - 'W', 'A', 'V', 'E', - 'f', 'm', 't', ' ', - 16, 0, 0, 0, - 0x01, 0x00, - }; - static const uint8_t hdr2[] = { - 'd', 'a', 't', 'a', - 0xFF, 0xFF, 0xFF, 0xFF, - }; - - if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED && format != ARRAY_DATA_UNKNOWN) - return FALSE; - if (frequency > VS1053_MAX_SAMPLE_RATE) - return FALSE; - - // Reset the chip if needed - if (!vs1053_isinit) { - vs1053_hard_reset(); - vs1053_isinit = TRUE; - } - - // Setup - if (format == ARRAY_DATA_8BITUNSIGNED || format == ARRAY_DATA_16BITSIGNED) { - bps = (gfxSampleFormatBits(format)+7)/8; - if (channel == GAUDIO_PLAY_STEREO) - bps *= 2; - brate = frequency * bps; - - // Write the RIFF header - waitforready(); - data_write(hdr1, sizeof(hdr1)); - buf[0] = channel == GAUDIO_PLAY_STEREO ? 2 : 1; buf[1] = 0; data_write(buf, 2); - buf[0] = frequency; buf[1] = frequency>>8; buf[2] = frequency>>16; buf[3] = frequency>>24; data_write(buf, 4); - buf[0] = brate; buf[1] = brate>>8; buf[2] = brate>>16; buf[3] = brate>>24; data_write(buf, 4); - waitforready(); // 32 bytes max before checking - buf[0] = bps; buf[1] = 0; data_write(buf, 2); - buf[0] = gfxSampleFormatBits(format); buf[1] = 0; data_write(buf, 2); - data_write(hdr2, sizeof(hdr2)); - } - return TRUE; -} - -bool_t gaudio_play_lld_set_volume(uint8_t vol) { - uint16_t tmp; - - // Volume is 0xFE -> 0x00. Adjust vol to match - vol = ~vol; - if (vol > 0xFE) - vol = 0xFE; - - tmp = 0; - tmp |= (( vol << VOL_LEFT_SHIFT ) & VOL_LEFT_MASK ); - tmp |= (( vol << VOL_RIGHT_SHIFT ) & VOL_RIGHT_MASK ); - - cmd_write(SCI_VOL, tmp); - - return TRUE; -} - -void gaudio_play_lld_start(void) { - - gfxSystemLock(); - // Get a new data buffer - if (pplay || !(pplay = gaudioPlayGetDataBlockI())) { - gfxSystemUnlock(); // Nothing to do - return; - } - - // Set up ready for the new buffer - playlen = pplay->len; - pdata = (uint8_t *)(pplay+1); - gfxSystemUnlock(); - - // Start the playing by starting the timer and executing FeedData immediately just to get things started - // We really should set the timer to be equivalent to half the available data but that is just too hard to calculate. - gtimerStart(&playTimer, FeedData, 0, TRUE, VS1053_POLL_RATE); - FeedData(0); -} - -void gaudio_play_lld_stop(void) { - uint8_t ch; - unsigned i; - - // Stop the timer interrupt - gtimerStop(&playTimer); - - // We may need to clean up the remaining buffer. - gfxSystemLock(); - if (pplay) { - gaudioPlayReleaseDataBlockI(pplay); - pplay = 0; - gaudioPlayDoneI(); - } - gfxSystemUnlock(); - - // Set CANCEL - cmd_write(SCI_MODE, cmd_read(SCI_MODE)|SM_CANCEL); - - // Write up to 2048 bytes of data - ch = 0; - for(i = 0; i < 2048; i++) { - if (!(i & 0x1F)) { - waitforready(); - if (!(cmd_read(SCI_MODE) & SM_CANCEL)) - break; - } - data_write(&ch, 1); - } - - // Make sure the cancel worked - waitforready(); - if ((cmd_read(SCI_MODE) & SM_CANCEL)) - vs1053_soft_reset(); - - // Send the terminating data - ch = vs1053_getendbyte(); - for(i = 0; i < 2052; i++) { - if (!(i & 0x1F)) - waitforready(); - data_write(&ch, 1); - } -} - -#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gaudio/vs1053/gaudio_play_vs1053.c b/drivers/gaudio/vs1053/gaudio_play_vs1053.c new file mode 100644 index 00000000..2aab288c --- /dev/null +++ b/drivers/gaudio/vs1053/gaudio_play_vs1053.c @@ -0,0 +1,361 @@ +/* + * 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 + */ + +#include "gfx.h" + +#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY + +/* Include the driver defines */ +#include "../../../src/gaudio/gaudio_driver_play.h" + +/* Include the vs1053 registers */ +#include "vs1053.h" + +/* Include the board interface */ +#include "gaudio_play_board.h" + +// Override-able parameters +#ifndef VS1053_CLK + #define VS1053_CLK 12288000 +#endif +#ifndef VS1053_FIRMWARE_PATCH + #define VS1053_FIRMWARE_PATCH FALSE +#endif +#ifndef VS1053_POLL_RATE + #define VS1053_POLL_RATE 5 +#endif + +// Load the patch file if desired. New format patches only. +#if VS1053_FIRMWARE_PATCH + #define SKIP_PLUGIN_VARNAME + static const uint16_t plugin[] = { /* Compressed plugin */ + #include "vs1053_patch.plg" + }; +#endif + +// Set various stuff based on the clock +#if VS1053_CLK >= 16192000 + #define SCI_MODE_STARTUP (SCI_MODE_DEFAULTS|SM_CLK_RANGE) + #define VS1053_CLKI (VS1053_CLK/2) +#else + #define SCI_MODE_STARTUP (SCI_MODE_DEFAULTS) + #define VS1053_CLKI (VS1053_CLK) +#endif +#if VS1053_CLKI > 13000000 || VS1053_CLKI < 12000000 + #error "GAUDIO(vs1053): VS1053_CLK is out of range" +#endif +#if VS1053_CLKI == 12288000 + #define SC_FREQ_ADJUST 0x0000 +#else + #define SC_FREQ_ADJUST ((VS1053_CLKI-8000000)/4000) +#endif +#define VS1053_MAX_SAMPLE_RATE (VS1053_CLKI/256) +#if VS1053_CLKI > 1228800 + #define SC_CLOCK_MODE (SC_MULT_3|SC_ADD_1|SC_FREQ_ADJUST) +#else + #define SC_CLOCK_MODE (SC_MULT_3_5|SC_ADD_1|SC_FREQ_ADJUST) +#endif + +// Our static variables +static bool_t vs1053_isinit; +static GTimer playTimer; + +// Some common macro's +#define waitforready() while(!board_dreq()) gfxSleepMilliseconds(5) + +static void cmd_write(uint16_t addr, uint16_t data) { + char buf[4]; + buf[0] = 2; + buf[1] = (char)addr; + buf[2] = (char)(data >> 8); + buf[3] = (char)data; + + waitforready(); + board_startcmdwrite(); + board_spiwrite(buf, 4); + board_endcmdwrite(); +} + +#if VS1053_CLK > 12288000 + static GFXINLINE void cmd_writenodreq(uint16_t addr, uint16_t data) { + uint8_t buf[4]; + + // This is the same as cmd_write() except for it doesn't wait for dreq first + buf[0] = 2; + buf[1] = (uint8_t)addr; + buf[2] = (uint8_t)(data >> 8); + buf[3] = (uint8_t)data; + + board_startcmdwrite(); + board_spiwrite(buf, 4); + board_endcmdwrite(); + } +#endif + +static uint16_t cmd_read(uint16_t addr) { + uint8_t buf[2]; + + buf[0] = 3; + buf[1] = (char)addr; + + board_startcmdread(); + board_spiwrite(buf, 2); + board_spiread(buf, 2); + board_endcmdread(); + return (((uint16_t)buf[0])<<8)|buf[1]; +} + +static void data_write(const uint8_t *data, unsigned len) { + board_startdatawrite(); + board_spiwrite(data, len); + board_enddatawrite(); +} + +#if VS1053_FIRMWARE_PATCH + static void LoadUserCode(void) { + int i; + uint16_t addr, n, val; + + for(i=0; i 12288000 + cmd_writenodreq(SCI_MODE, SCI_MODE_STARTUP); // Set super-clock before dreq + #endif + + // Set up registers + cmd_write(SCI_MODE, SCI_MODE_STARTUP); // Set mode + cmd_write(SCI_CLOCKF, SC_CLOCK_MODE); // Set clocks + board_init_end(); // Clocks are now set up + cmd_write(SCI_BASS, 0x0000); // No treble or bass boost + cmd_write(SCI_VOL, VOL_MAX); // Maximum volume + + // Load any firmware + #if VS1053_FIRMWARE_PATCH + LoadUserCode(); + + // Reset mode just in case + cmd_write(SCI_MODE, SCI_MODE_STARTUP); + #endif +} + +static void vs1053_soft_reset(void) { + cmd_write(SCI_MODE, cmd_read(SCI_MODE)|SM_RESET); + gfxSleepMilliseconds(1); // Wait for at least 2uS + waitforready(); + + // Reload any firmware + #if VS1053_FIRMWARE_PATCH + LoadUserCode(); + + // Reset mode just in case + cmd_write(SCI_MODE, SCI_MODE_STARTUP); + #endif +} + +static uint16_t vs1053_getendbyte(void) { + cmd_write(SCI_WRAMADDR, WRAMADDR_EXTRAPARAMS+4); + return cmd_read(SCI_WRAM); +} + +static GTimer playTimer; +static GDataBuffer *pplay; +static size_t playlen; +static uint8_t *pdata; + +static void FeedData(void *param) { + unsigned len; + (void) param; + + // While there is data space + while (board_dreq()) { + + // Send up to 32 bytes + len = playlen; + if (len > 32) len = 32; + data_write(pdata, len); + pdata += len; + playlen -= len; + + // Have we finished the buffer + while (!playlen) { + gfxSystemLock(); + gaudioPlayReleaseDataBlockI(pplay); + + // Get a new data buffer + if (!(pplay = gaudioPlayGetDataBlockI())) { + // We should really only do the play-done when the audio + // has really finished playing. Unfortunately there seems + // to be no documented way of determining this. + gaudioPlayDoneI(); + gfxSystemUnlock(); + gtimerStop(&playTimer); + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + pdata = (uint8_t *)(pplay+1); + gfxSystemUnlock(); + } + } +} + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + uint32_t brate; + uint32_t bps; + uint8_t buf[4]; + static const uint8_t hdr1[] = { + 'R', 'I', 'F', 'F', + 0xFF, 0xFF, 0xFF, 0xFF, + 'W', 'A', 'V', 'E', + 'f', 'm', 't', ' ', + 16, 0, 0, 0, + 0x01, 0x00, + }; + static const uint8_t hdr2[] = { + 'd', 'a', 't', 'a', + 0xFF, 0xFF, 0xFF, 0xFF, + }; + + if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED && format != ARRAY_DATA_UNKNOWN) + return FALSE; + if (frequency > VS1053_MAX_SAMPLE_RATE) + return FALSE; + + // Reset the chip if needed + if (!vs1053_isinit) { + vs1053_hard_reset(); + vs1053_isinit = TRUE; + } + + // Setup + if (format == ARRAY_DATA_8BITUNSIGNED || format == ARRAY_DATA_16BITSIGNED) { + bps = (gfxSampleFormatBits(format)+7)/8; + if (channel == GAUDIO_PLAY_STEREO) + bps *= 2; + brate = frequency * bps; + + // Write the RIFF header + waitforready(); + data_write(hdr1, sizeof(hdr1)); + buf[0] = channel == GAUDIO_PLAY_STEREO ? 2 : 1; buf[1] = 0; data_write(buf, 2); + buf[0] = frequency; buf[1] = frequency>>8; buf[2] = frequency>>16; buf[3] = frequency>>24; data_write(buf, 4); + buf[0] = brate; buf[1] = brate>>8; buf[2] = brate>>16; buf[3] = brate>>24; data_write(buf, 4); + waitforready(); // 32 bytes max before checking + buf[0] = bps; buf[1] = 0; data_write(buf, 2); + buf[0] = gfxSampleFormatBits(format); buf[1] = 0; data_write(buf, 2); + data_write(hdr2, sizeof(hdr2)); + } + return TRUE; +} + +bool_t gaudio_play_lld_set_volume(uint8_t vol) { + uint16_t tmp; + + // Volume is 0xFE -> 0x00. Adjust vol to match + vol = ~vol; + if (vol > 0xFE) + vol = 0xFE; + + tmp = 0; + tmp |= (( vol << VOL_LEFT_SHIFT ) & VOL_LEFT_MASK ); + tmp |= (( vol << VOL_RIGHT_SHIFT ) & VOL_RIGHT_MASK ); + + cmd_write(SCI_VOL, tmp); + + return TRUE; +} + +void gaudio_play_lld_start(void) { + + gfxSystemLock(); + // Get a new data buffer + if (pplay || !(pplay = gaudioPlayGetDataBlockI())) { + gfxSystemUnlock(); // Nothing to do + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + pdata = (uint8_t *)(pplay+1); + gfxSystemUnlock(); + + // Start the playing by starting the timer and executing FeedData immediately just to get things started + // We really should set the timer to be equivalent to half the available data but that is just too hard to calculate. + gtimerStart(&playTimer, FeedData, 0, TRUE, VS1053_POLL_RATE); + FeedData(0); +} + +void gaudio_play_lld_stop(void) { + uint8_t ch; + unsigned i; + + // Stop the timer interrupt + gtimerStop(&playTimer); + + // We may need to clean up the remaining buffer. + gfxSystemLock(); + if (pplay) { + gaudioPlayReleaseDataBlockI(pplay); + pplay = 0; + gaudioPlayDoneI(); + } + gfxSystemUnlock(); + + // Set CANCEL + cmd_write(SCI_MODE, cmd_read(SCI_MODE)|SM_CANCEL); + + // Write up to 2048 bytes of data + ch = 0; + for(i = 0; i < 2048; i++) { + if (!(i & 0x1F)) { + waitforready(); + if (!(cmd_read(SCI_MODE) & SM_CANCEL)) + break; + } + data_write(&ch, 1); + } + + // Make sure the cancel worked + waitforready(); + if ((cmd_read(SCI_MODE) & SM_CANCEL)) + vs1053_soft_reset(); + + // Send the terminating data + ch = vs1053_getendbyte(); + for(i = 0; i < 2052; i++) { + if (!(i & 0x1F)) + waitforready(); + data_write(&ch, 1); + } +} + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c index ec0df514..cd54155c 100644 --- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c +++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_ED060SC4 -#include "drivers/gdisp/ED060SC4/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_ED060SC4.h" diff --git a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c index 3456a508..6adead64 100644 --- a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c +++ b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_HX8347D -#include "drivers/gdisp/HX8347D/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_HX8347D.h" @@ -36,7 +36,7 @@ /* Driver local functions. */ /*===========================================================================*/ -#include "drivers/gdisp/HX8347D/HX8347D.h" +#include "HX8347D.h" #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index d3d1ca0e..e33b028b 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -20,8 +20,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_ILI9320 -#include "drivers/gdisp/ILI9320/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_ILI9320.h" diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c index 5637b0b2..663ed61d 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c +++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c @@ -20,8 +20,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_ILI9325 -#include "drivers/gdisp/ILI9325/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_ILI9325.h" diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c index 6a9a929b..a4ee660f 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c +++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c @@ -19,8 +19,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_ILI9341 -#include "drivers/gdisp/ILI9341/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_ILI9341.h" @@ -41,7 +41,7 @@ #define GDISP_INITIAL_BACKLIGHT 100 #endif -#include "drivers/gdisp/ILI9341/ILI9341.h" +#include "ILI9341.h" /*===========================================================================*/ /* Driver local functions. */ diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c index f992cdb2..0a207e0e 100644 --- a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c +++ b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c @@ -20,8 +20,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_ILI93xx -#include "drivers/gdisp/ILI93xx/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_ILI93xx.h" diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c index dec1cc31..bd637f0e 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c +++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c @@ -19,8 +19,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_ILI9481 -#include "drivers/gdisp/ILI9481/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_ILI9481.h" diff --git a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c index 067851e6..6a48ad6f 100644 --- a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c +++ b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c @@ -21,7 +21,7 @@ #define GDISP_DRIVER_VMT GDISPVMT_LGDP4532 #include "gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_LGDP4532.h" diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c index 72841b64..b50a8537 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c @@ -19,8 +19,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_Nokia6610GE12 -#include "drivers/gdisp/Nokia6610GE12/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_Nokia6610GE12.h" @@ -28,7 +28,7 @@ /* Driver local definitions. */ /*===========================================================================*/ -#include "drivers/gdisp/Nokia6610GE12/GE12.h" +#include "GE12.h" #define GDISP_SCAN_LINES 132 #define GDISP_SLEEP_SIZE 32 /* Sleep mode window lines - this must be 32 on this controller */ diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index ed885d19..afa310fb 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -51,8 +51,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_Nokia6610GE8 -#include "drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_Nokia6610GE8.h" @@ -60,7 +60,7 @@ /* Driver local definitions. */ /*===========================================================================*/ -#include "drivers/gdisp/Nokia6610GE8/GE8.h" +#include "GE8.h" #define GDISP_SCAN_LINES 132 diff --git a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c index ddc67be0..8db73bc5 100644 --- a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c +++ b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_PCD8544 -#include "drivers/gdisp/PCD8544/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_PCD8544.h" /*===========================================================================*/ @@ -26,7 +26,7 @@ #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0) -#include "drivers/gdisp/PCD8544/PCD8544.h" +#include "PCD8544.h" /*===========================================================================*/ /* Driver local routines. */ diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c index f37bed0d..0716215c 100644 --- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c +++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_PCF8812 -#include "drivers/gdisp/PCF8812/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_PCF8812.h" /*===========================================================================*/ @@ -29,7 +29,7 @@ #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0) -#include "drivers/gdisp/PCF8812/PCF8812.h" +#include "PCF8812.h" /*===========================================================================*/ /* Driver local routines. */ diff --git a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c index 94832248..038ffc1d 100644 --- a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c +++ b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c @@ -20,8 +20,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_R61505U -#include "drivers/gdisp/R61505U/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_R61505U.h" diff --git a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c index a962f2f2..4026237a 100644 --- a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c +++ b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ #define GDISP_DRIVER_VMT GDISPVMT_RA8875 -#include "drivers/gdisp/RA8875/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" /* include the users board interface */ #include "board_RA8875.h" diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c index b259b5ca..4e174c4d 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c +++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c @@ -19,8 +19,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_S6D1121 -#include "drivers/gdisp/S6D1121/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_S6D1121.h" diff --git a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c index 9a556a7e..163be520 100644 --- a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c +++ b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c @@ -24,8 +24,8 @@ #undef GDISP_SCREEN_WIDTH #endif -#include "drivers/gdisp/SPFD54124B/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_SPFD54124B.h" diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index 82ad57f0..722a71b3 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_SSD1289 -#include "drivers/gdisp/SSD1289/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_SSD1289.h" diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index 5a950b0d..65edbaee 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_SSD1306 -#include "drivers/gdisp/SSD1306/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_SSD1306.h" #include // for memset @@ -42,7 +42,7 @@ #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) -#include "drivers/gdisp/SSD1306/SSD1306.h" +#include "SSD1306.h" /*===========================================================================*/ /* Driver local functions. */ diff --git a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c index f3d4e225..93a5d0a8 100644 --- a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c +++ b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c @@ -20,7 +20,7 @@ #define GDISP_DRIVER_VMT GDISPVMT_SSD1331 #include "gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_SSD1331.h" diff --git a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c index 35f059cb..e7fd6cff 100644 --- a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c +++ b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c @@ -20,7 +20,7 @@ #define GDISP_DRIVER_VMT GDISPVMT_SSD1351 #include "gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_SSD1351.h" diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c index d68235f9..98436040 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c +++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_SSD1963 -#include "drivers/gdisp/SSD1963/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #define CALC_PERIOD(w,b,f,p) (p+b+w+f) #define CALC_FPR(w,h,hb,hf,hp,vb,vf,vp,fps) ((fps * CALC_PERIOD(w,hb,hf,hp) * CALC_PERIOD(h,vb,vf,vp) * 1048576)/100000000) @@ -69,7 +69,7 @@ typedef struct LCD_Parameters { /* Driver local functions. */ /*===========================================================================*/ -#include "drivers/gdisp/SSD1963/ssd1963.h" +#include "ssd1963.h" #define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c index 29afaab5..5ae25b1c 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c +++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_SSD2119 -#include "drivers/gdisp/SSD2119/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_SSD2119.h" @@ -38,7 +38,7 @@ #define GDISP_NO_DMA_FROM_STACK FALSE #endif -#include "drivers/gdisp/SSD2119/ssd2119.h" +#include "ssd2119.h" /*===========================================================================*/ /* Driver local functions. */ diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c index dc0b1f84..9ab46b57 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c +++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_ST7565 -#include "drivers/gdisp/ST7565/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_ST7565.h" @@ -34,7 +34,7 @@ #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) -#include "drivers/gdisp/ST7565/st7565.h" +#include "st7565.h" /*===========================================================================*/ /* Driver config defaults for backward compatibility. */ diff --git a/drivers/gdisp/STM32F429iDiscovery/gdisp_lld_STM32F429iDiscovery.c b/drivers/gdisp/STM32F429iDiscovery/gdisp_lld_STM32F429iDiscovery.c index 204097d3..91e914d3 100644 --- a/drivers/gdisp/STM32F429iDiscovery/gdisp_lld_STM32F429iDiscovery.c +++ b/drivers/gdisp/STM32F429iDiscovery/gdisp_lld_STM32F429iDiscovery.c @@ -23,8 +23,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_STM32F429iDiscovery -#include "drivers/gdisp/STM32F429iDiscovery/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "stm32_ltdc.h" diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index 0fb8ba5a..949088b5 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -23,8 +23,8 @@ #endif #define GDISP_DRIVER_VMT GDISPVMT_STM32LTDC -#include "drivers/gdisp/STM32LTDC/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "stm32_ltdc.h" diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c index 6e0f4371..aa7738ba 100644 --- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c +++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP #define GDISP_DRIVER_VMT GDISPVMT_TLS8204 -#include "drivers/gdisp/TLS8204/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_TLS8204.h" /*===========================================================================*/ @@ -26,7 +26,7 @@ #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0) -#include "drivers/gdisp/TLS8204/TLS8204.h" +#include "TLS8204.h" /*===========================================================================*/ /* Driver local routines. */ diff --git a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c index 1d21ab6f..a7d39fd8 100644 --- a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c +++ b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c @@ -10,8 +10,8 @@ #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ #define GDISP_DRIVER_VMT GDISPVMT_TestStub -#include "drivers/gdisp/TestStub/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #ifndef GDISP_SCREEN_HEIGHT #define GDISP_SCREEN_HEIGHT 128 diff --git a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c index 79432bcd..e6a505ae 100644 --- a/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c +++ b/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c @@ -15,8 +15,8 @@ typedef struct fbInfo { } fbInfo; #define GDISP_DRIVER_VMT GDISPVMT_framebuffer -#include "drivers/gdisp/framebuffer/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "gdisp_lld_config.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "board_framebuffer.h" typedef struct fbPriv { diff --git a/drivers/ginput/dial/GADC/driver.mk b/drivers/ginput/dial/GADC/driver.mk index 763549b8..24370422 100644 --- a/drivers/ginput/dial/GADC/driver.mk +++ b/drivers/ginput/dial/GADC/driver.mk @@ -1,5 +1,2 @@ -# List the required driver. -GFXSRC += $(GFXLIB)/drivers/ginput/dial/GADC/ginput_lld_dial.c - -# Required include directories GFXINC += $(GFXLIB)/drivers/ginput/dial/GADC +GFXSRC += $(GFXLIB)/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial.c b/drivers/ginput/dial/GADC/ginput_lld_dial.c deleted file mode 100644 index 9ad43748..00000000 --- a/drivers/ginput/dial/GADC/ginput_lld_dial.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 - */ - -#include "gfx.h" - -#if GFX_USE_GINPUT && GINPUT_NEED_DIAL - -#include "src/ginput/ginput_driver_dial.h" - -#if GINPUT_DIAL_NUM_PORTS >= 5 - #error "GINPUT: Dial - GADC driver currently only supports 4 devices" -#endif - -static adcsample_t samplebuf[GINPUT_DIAL_NUM_PORTS]; - -#if GINPUT_DIAL_CYCLE_POLL - static uint16_t cycle; -#endif - -static void GADCCallback(adcsample_t *buffer, void *param) { - ((DialCallbackFn)param)(buffer-samplebuf, buffer[0]); -} - -void ginput_lld_dial_init(void) { - #if GINPUT_DIAL_CYCLE_POLL - cycle = 0; - #endif -} - -void ginput_lld_dial_poll(DialCallbackFn fn) { - #if GINPUT_DIAL_CYCLE_POLL - switch(cycle++) { - #if GINPUT_DIAL_NUM_PORTS >= 1 - case 0: - gadcLowSpeedStart(GINPUT_DIAL_DEVICE0, samplebuf+0, GADCCallback, (void *)fn); - break; - #endif - #if GINPUT_DIAL_NUM_PORTS >= 2 - case 1: - gadcLowSpeedStart(GINPUT_DIAL_DEVICE1, samplebuf+1, GADCCallback, (void *)fn); - break; - #endif - #if GINPUT_DIAL_NUM_PORTS >= 3 - case 2: - gadcLowSpeedStart(GINPUT_DIAL_DEVICE2, samplebuf+2, GADCCallback, (void *)fn); - break; - #endif - #if GINPUT_DIAL_NUM_PORTS >= 4 - case 3: - gadcLowSpeedStart(GINPUT_DIAL_DEVICE3, samplebuf+3, GADCCallback, (void *)fn); - break; - #endif - } - if (cycle >= GINPUT_DIAL_NUM_PORTS) - cycle = 0; - #else - #if GINPUT_DIAL_NUM_PORTS >= 1 - gadcLowSpeedStart(GINPUT_DIAL_DEVICE0, samplebuf+0, GADCCallback, (void *)fn); - #endif - #if GINPUT_DIAL_NUM_PORTS >= 2 - gadcLowSpeedStart(GINPUT_DIAL_DEVICE1, samplebuf+1, GADCCallback, (void *)fn); - #endif - #if GINPUT_DIAL_NUM_PORTS >= 3 - gadcLowSpeedStart(GINPUT_DIAL_DEVICE2, samplebuf+2, GADCCallback, (void *)fn); - #endif - #if GINPUT_DIAL_NUM_PORTS >= 4 - gadcLowSpeedStart(GINPUT_DIAL_DEVICE3, samplebuf+3, GADCCallback, (void *)fn); - #endif - #endif -} - -#endif /* GFX_USE_GINPUT && GINPUT_NEED_DIAL */ diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c b/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c new file mode 100644 index 00000000..49e59a24 --- /dev/null +++ b/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c @@ -0,0 +1,76 @@ +/* + * 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 + */ + +#include "gfx.h" + +#if GFX_USE_GINPUT && GINPUT_NEED_DIAL + +#include "../../../../src/ginput/ginput_driver_dial.h" + +#if GINPUT_DIAL_NUM_PORTS >= 5 + #error "GINPUT: Dial - GADC driver currently only supports 4 devices" +#endif + +static adcsample_t samplebuf[GINPUT_DIAL_NUM_PORTS]; + +#if GINPUT_DIAL_CYCLE_POLL + static uint16_t cycle; +#endif + +static void GADCCallback(adcsample_t *buffer, void *param) { + ((DialCallbackFn)param)(buffer-samplebuf, buffer[0]); +} + +void ginput_lld_dial_init(void) { + #if GINPUT_DIAL_CYCLE_POLL + cycle = 0; + #endif +} + +void ginput_lld_dial_poll(DialCallbackFn fn) { + #if GINPUT_DIAL_CYCLE_POLL + switch(cycle++) { + #if GINPUT_DIAL_NUM_PORTS >= 1 + case 0: + gadcLowSpeedStart(GINPUT_DIAL_DEVICE0, samplebuf+0, GADCCallback, (void *)fn); + break; + #endif + #if GINPUT_DIAL_NUM_PORTS >= 2 + case 1: + gadcLowSpeedStart(GINPUT_DIAL_DEVICE1, samplebuf+1, GADCCallback, (void *)fn); + break; + #endif + #if GINPUT_DIAL_NUM_PORTS >= 3 + case 2: + gadcLowSpeedStart(GINPUT_DIAL_DEVICE2, samplebuf+2, GADCCallback, (void *)fn); + break; + #endif + #if GINPUT_DIAL_NUM_PORTS >= 4 + case 3: + gadcLowSpeedStart(GINPUT_DIAL_DEVICE3, samplebuf+3, GADCCallback, (void *)fn); + break; + #endif + } + if (cycle >= GINPUT_DIAL_NUM_PORTS) + cycle = 0; + #else + #if GINPUT_DIAL_NUM_PORTS >= 1 + gadcLowSpeedStart(GINPUT_DIAL_DEVICE0, samplebuf+0, GADCCallback, (void *)fn); + #endif + #if GINPUT_DIAL_NUM_PORTS >= 2 + gadcLowSpeedStart(GINPUT_DIAL_DEVICE1, samplebuf+1, GADCCallback, (void *)fn); + #endif + #if GINPUT_DIAL_NUM_PORTS >= 3 + gadcLowSpeedStart(GINPUT_DIAL_DEVICE2, samplebuf+2, GADCCallback, (void *)fn); + #endif + #if GINPUT_DIAL_NUM_PORTS >= 4 + gadcLowSpeedStart(GINPUT_DIAL_DEVICE3, samplebuf+3, GADCCallback, (void *)fn); + #endif + #endif +} + +#endif /* GFX_USE_GINPUT && GINPUT_NEED_DIAL */ diff --git a/drivers/ginput/toggle/Pal/driver.mk b/drivers/ginput/toggle/Pal/driver.mk index b48fe83a..f2d32830 100644 --- a/drivers/ginput/toggle/Pal/driver.mk +++ b/drivers/ginput/toggle/Pal/driver.mk @@ -1,5 +1,2 @@ -# List the required driver. -GFXSRC += $(GFXLIB)/drivers/ginput/toggle/Pal/ginput_lld_toggle.c - -# Required include directories GFXINC += $(GFXLIB)/drivers/ginput/toggle/Pal +GFXSRC += $(GFXLIB)/drivers/ginput/toggle/Pal/ginput_lld_toggle_Pal.c diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c deleted file mode 100644 index 96ef071e..00000000 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 - */ - -#include "gfx.h" - -#if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) /*|| defined(__DOXYGEN__)*/ - -#include "src/ginput/ginput_driver_toggle.h" - -GINPUT_TOGGLE_DECLARE_STRUCTURE(); - -void ginput_lld_toggle_init(const GToggleConfig *ptc) { - palSetGroupMode(((IOBus *)ptc->id)->portid, ptc->mask, 0, ptc->mode); -} - -unsigned ginput_lld_toggle_getbits(const GToggleConfig *ptc) { - return palReadBus((IOBus *)ptc->id); -} - -#endif /* GFX_USE_GINPUT && GINPUT_NEED_TOGGLE */ diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_Pal.c b/drivers/ginput/toggle/Pal/ginput_lld_toggle_Pal.c new file mode 100644 index 00000000..1a16b70f --- /dev/null +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_Pal.c @@ -0,0 +1,24 @@ +/* + * 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 + */ + +#include "gfx.h" + +#if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) /*|| defined(__DOXYGEN__)*/ + +#include "../../../../src/ginput/ginput_driver_toggle.h" + +GINPUT_TOGGLE_DECLARE_STRUCTURE(); + +void ginput_lld_toggle_init(const GToggleConfig *ptc) { + palSetGroupMode(((IOBus *)ptc->id)->portid, ptc->mask, 0, ptc->mode); +} + +unsigned ginput_lld_toggle_getbits(const GToggleConfig *ptc) { + return palReadBus((IOBus *)ptc->id); +} + +#endif /* GFX_USE_GINPUT && GINPUT_NEED_TOGGLE */ diff --git a/drivers/ginput/touch/ADS7843/driver.mk b/drivers/ginput/touch/ADS7843/driver.mk index 1a0eaf8e..7d2e4681 100644 --- a/drivers/ginput/touch/ADS7843/driver.mk +++ b/drivers/ginput/touch/ADS7843/driver.mk @@ -1,2 +1 @@ -# List the required driver. GFXSRC += $(GFXLIB)/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c diff --git a/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c b/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c index e9492f55..d5412ad2 100644 --- a/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c +++ b/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c @@ -10,7 +10,7 @@ #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) #define GMOUSE_DRIVER_VMT GMOUSEVMT_ADS7843 -#include "src/ginput/ginput_driver_mouse.h" +#include "../../../../src/ginput/ginput_driver_mouse.h" // Get the hardware interface #include "gmouse_lld_ADS7843_board.h" diff --git a/drivers/ginput/touch/FT5x06/driver.mk b/drivers/ginput/touch/FT5x06/driver.mk index 741464e8..fc227e8b 100644 --- a/drivers/ginput/touch/FT5x06/driver.mk +++ b/drivers/ginput/touch/FT5x06/driver.mk @@ -1,2 +1 @@ -# List the required driver. GFXSRC += $(GFXLIB)/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c diff --git a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c index da7c46ed..dbd5981c 100644 --- a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c +++ b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06.c @@ -10,13 +10,13 @@ #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE #define GMOUSE_DRIVER_VMT GMOUSEVMT_FT5x06 -#include "src/ginput/ginput_driver_mouse.h" +#include "../../../../src/ginput/ginput_driver_mouse.h" // Get the hardware interface #include "gmouse_lld_FT5x06_board.h" // Hardware definitions -#include "drivers/ginput/touch/FT5x06/ft5x06.h" +#include "ft5x06.h" static bool_t MouseInit(GMouse* m, unsigned driverinstance) { if (!init_board(m, driverinstance)) diff --git a/drivers/ginput/touch/MAX11802/driver.mk b/drivers/ginput/touch/MAX11802/driver.mk index 246e48b3..0df8cf06 100644 --- a/drivers/ginput/touch/MAX11802/driver.mk +++ b/drivers/ginput/touch/MAX11802/driver.mk @@ -1,2 +1 @@ -# List the required driver. GFXSRC += $(GFXLIB)/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c diff --git a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c index 713b9aad..8976cceb 100644 --- a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c +++ b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c @@ -10,10 +10,10 @@ #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE #define GMOUSE_DRIVER_VMT GMOUSEVMT_MAX11802 -#include "src/ginput/ginput_driver_mouse.h" +#include "../../../../src/ginput/ginput_driver_mouse.h" // Hardware definitions -#include "drivers/ginput/touch/MAX11802/max11802.h" +#include "max11802.h" // Get the hardware interface #include "gmouse_lld_MAX11802_board.h" diff --git a/drivers/ginput/touch/MCU/driver.mk b/drivers/ginput/touch/MCU/driver.mk index c8c792b2..dfd96b6f 100644 --- a/drivers/ginput/touch/MCU/driver.mk +++ b/drivers/ginput/touch/MCU/driver.mk @@ -1,2 +1 @@ -# List the required driver. GFXSRC += $(GFXLIB)/drivers/ginput/touch/MCU/gmouse_lld_MCU.c diff --git a/drivers/ginput/touch/MCU/gmouse_lld_MCU.c b/drivers/ginput/touch/MCU/gmouse_lld_MCU.c index a69ae72e..8204e28c 100644 --- a/drivers/ginput/touch/MCU/gmouse_lld_MCU.c +++ b/drivers/ginput/touch/MCU/gmouse_lld_MCU.c @@ -10,7 +10,7 @@ #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE #define GMOUSE_DRIVER_VMT GMOUSEVMT_MCU -#include "src/ginput/ginput_driver_mouse.h" +#include "../../../../src/ginput/ginput_driver_mouse.h" // Get the hardware interface #include "gmouse_lld_MCU_board.h" diff --git a/drivers/ginput/touch/STMPE610/driver.mk b/drivers/ginput/touch/STMPE610/driver.mk index 364a01ff..d8fa97d6 100644 --- a/drivers/ginput/touch/STMPE610/driver.mk +++ b/drivers/ginput/touch/STMPE610/driver.mk @@ -1,2 +1 @@ -# List the required driver. GFXSRC += $(GFXLIB)/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c diff --git a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c index acfa202e..2eb8f429 100644 --- a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c +++ b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c @@ -10,10 +10,10 @@ #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE #define GMOUSE_DRIVER_VMT GMOUSEVMT_STMPE610 -#include "src/ginput/ginput_driver_mouse.h" +#include "../../../../src/ginput/ginput_driver_mouse.h" // Hardware definitions -#include "drivers/ginput/touch/STMPE610/stmpe610.h" +#include "stmpe610.h" // Get the hardware interface #include "gmouse_lld_STMPE610_board.h" diff --git a/drivers/ginput/touch/STMPE811/driver.mk b/drivers/ginput/touch/STMPE811/driver.mk index cf12507b..12ce9243 100644 --- a/drivers/ginput/touch/STMPE811/driver.mk +++ b/drivers/ginput/touch/STMPE811/driver.mk @@ -1,2 +1 @@ -# List the required driver. GFXSRC += $(GFXLIB)/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c diff --git a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c index 444888af..8cb1b70e 100644 --- a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c +++ b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c @@ -10,10 +10,10 @@ #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE #define GMOUSE_DRIVER_VMT GMOUSEVMT_STMPE811 -#include "src/ginput/ginput_driver_mouse.h" +#include "../../../../src/ginput/ginput_driver_mouse.h" // Hardware definitions -#include "drivers/ginput/touch/STMPE811/stmpe811.h" +#include "stmpe811.h" // Get the hardware interface #include "gmouse_lld_STMPE811_board.h" diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c index f731d3b5..557e4ad0 100644 --- a/drivers/multiple/Win32/gdisp_lld_Win32.c +++ b/drivers/multiple/Win32/gdisp_lld_Win32.c @@ -14,7 +14,7 @@ #define GDISP_DRIVER_VMT GDISPVMT_Win32 #include "gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "../../../src/gdisp/gdisp_driver.h" // Configuration parameters for this driver #ifndef GDISP_SCREEN_WIDTH @@ -82,7 +82,7 @@ #if GINPUT_NEED_TOGGLE /* Include toggle support code */ - #include "src/ginput/ginput_driver_toggle.h" + #include "../../../src/ginput/ginput_driver_toggle.h" // Hack until toggle use gdriver. static GDisplay *toggleWindow; @@ -91,7 +91,7 @@ #if GINPUT_NEED_MOUSE // Include mouse support code #define GMOUSE_DRIVER_VMT GMOUSEVMT_Win32 - #include "src/ginput/ginput_driver_mouse.h" + #include "../../../src/ginput/ginput_driver_mouse.h" // Forward definitions static bool_t Win32MouseInit(GMouse *m, unsigned driverinstance); @@ -132,14 +132,14 @@ #if GINPUT_NEED_KEYBOARD #define GKEYBOARD_DRIVER_VMT GKEYBOARDVMT_Win32 - #include "src/ginput/ginput_driver_keyboard.h" + #include "../../../src/ginput/ginput_driver_keyboard.h" #if !GKEYBOARD_WIN32_NO_LAYOUT #if GKEYBOARD_LAYOUT_OFF #error "The Win32 keyboard driver is using the layout engine. Please set GKEYBOARD_LAYOUT_OFF=FALSE or GKEYBOARD_WIN32_NO_LAYOUT=TRUE." #endif - #include "src/ginput/ginput_keyboard_microcode.h" + #include "../../../src/ginput/ginput_keyboard_microcode.h" // Forward definitions extern uint8_t GKEYBOARD_WIN32_DEFAULT_LAYOUT[]; diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c index 02091c8e..0b10c7c5 100644 --- a/drivers/multiple/X/gdisp_lld_X.c +++ b/drivers/multiple/X/gdisp_lld_X.c @@ -20,7 +20,7 @@ #define GDISP_DRIVER_VMT GDISPVMT_X11 #include "gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "../../../src/gdisp/gdisp_driver.h" // Configuration parameters for this driver #ifndef GDISP_FORCE_24BIT @@ -56,7 +56,7 @@ #if GINPUT_NEED_MOUSE // Include mouse support code #define GMOUSE_DRIVER_VMT GMOUSEVMT_X11 - #include "src/ginput/ginput_driver_mouse.h" + #include "../../../src/ginput/ginput_driver_mouse.h" // Forward definitions static bool_t XMouseInit(GMouse *m, unsigned driverinstance); @@ -98,7 +98,7 @@ #if GINPUT_NEED_KEYBOARD // Include mouse support code #define GKEYBOARD_DRIVER_VMT GKEYBOARDVMT_X - #include "src/ginput/ginput_driver_keyboard.h" + #include "../../../src/ginput/ginput_driver_keyboard.h" #if !GKEYBOARD_X_NO_LAYOUT #if GKEYBOARD_LAYOUT_OFF @@ -108,7 +108,7 @@ // Forward definitions extern uint8_t GKEYBOARD_X_DEFAULT_LAYOUT[]; - #include "src/ginput/ginput_keyboard_microcode.h" + #include "../../../src/ginput/ginput_keyboard_microcode.h" #include // This is the layout code for the English US keyboard. diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c index d6279127..88a59c8e 100644 --- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c +++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c @@ -14,7 +14,7 @@ #define GDISP_DRIVER_VMT GDISPVMT_uGFXnet #include "gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" +#include "../../../src/gdisp/gdisp_driver.h" #include "uGFXnetProtocol.h" #ifndef GDISP_SCREEN_WIDTH @@ -39,7 +39,7 @@ #if GINPUT_NEED_MOUSE // Include mouse support code #define GMOUSE_DRIVER_VMT GMOUSEVMT_uGFXnet - #include "src/ginput/ginput_driver_mouse.h" + #include "../../../src/ginput/ginput_driver_mouse.h" // Forward definitions static bool_t NMouseInit(GMouse *m, unsigned driverinstance); diff --git a/gfxconf.example.h b/gfxconf.example.h index 71e6ff58..36b4cda4 100644 --- a/gfxconf.example.h +++ b/gfxconf.example.h @@ -288,9 +288,7 @@ // GADC // /////////////////////////////////////////////////////////////////////////// //#define GFX_USE_GADC FALSE - -//#define GADC_MAX_LOWSPEED_DEVICES 4 - +// #define GADC_MAX_LOWSPEED_DEVICES 4 /////////////////////////////////////////////////////////////////////////// // GAUDIO // @@ -299,7 +297,6 @@ // #define GAUDIO_NEED_PLAY FALSE // #define GAUDIO_NEED_RECORD FALSE - /////////////////////////////////////////////////////////////////////////// // GMISC // /////////////////////////////////////////////////////////////////////////// diff --git a/src/gadc/gadc.c b/src/gadc/gadc.c index ec0bc880..32a30930 100644 --- a/src/gadc/gadc.c +++ b/src/gadc/gadc.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GADC diff --git a/src/gadc/gadc.h b/src/gadc/gadc.h index 461e490e..eb29865d 100644 --- a/src/gadc/gadc.h +++ b/src/gadc/gadc.h @@ -38,7 +38,7 @@ #ifndef _GADC_H #define _GADC_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GADC || defined(__DOXYGEN__) diff --git a/src/gadc/gadc_driver.h b/src/gadc/gadc_driver.h index 683c78ea..f821b7aa 100644 --- a/src/gadc/gadc_driver.h +++ b/src/gadc/gadc_driver.h @@ -20,7 +20,7 @@ #ifndef _GADC_LLD_H #define _GADC_LLD_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GADC || defined(__DOXYGEN__) diff --git a/src/gaudio/gaudio.c b/src/gaudio/gaudio.c index 0abc9382..a9f20357 100644 --- a/src/gaudio/gaudio.c +++ b/src/gaudio/gaudio.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GAUDIO diff --git a/src/gaudio/gaudio.h b/src/gaudio/gaudio.h index 23403b15..7473373c 100644 --- a/src/gaudio/gaudio.h +++ b/src/gaudio/gaudio.h @@ -18,7 +18,7 @@ #ifndef _GAUDIO_H #define _GAUDIO_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GAUDIO || defined(__DOXYGEN__) diff --git a/src/gaudio/gaudio_driver_play.h b/src/gaudio/gaudio_driver_play.h index 56c37347..622769f1 100644 --- a/src/gaudio/gaudio_driver_play.h +++ b/src/gaudio/gaudio_driver_play.h @@ -20,7 +20,7 @@ #ifndef _GAUDIO_PLAY_LLD_H #define _GAUDIO_PLAY_LLD_H -#include "gfx.h" +#include "../../gfx.h" #if (GFX_USE_GAUDIO && GAUDIO_NEED_PLAY) || defined(__DOXYGEN__) diff --git a/src/gaudio/gaudio_driver_record.h b/src/gaudio/gaudio_driver_record.h index 0b63df61..5cbe4532 100644 --- a/src/gaudio/gaudio_driver_record.h +++ b/src/gaudio/gaudio_driver_record.h @@ -20,7 +20,7 @@ #ifndef _GAUDIO_RECORD_LLD_H #define _GAUDIO_RECORD_LLD_H -#include "gfx.h" +#include "../../gfx.h" #if (GFX_USE_GAUDIO && GAUDIO_NEED_RECORD) || defined(__DOXYGEN__) diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 31f08bec..25fa2c4e 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index 5c90a490..e6b56f2a 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -27,7 +27,7 @@ #ifndef _GDISP_H #define _GDISP_H -#include "gfx.h" +#include "../../gfx.h" /* This type definition is defined here as it gets used in other gfx sub-systems even * if GFX_USE_GDISP is FALSE. @@ -153,6 +153,7 @@ extern GDisplay *GDISP; // Pull in the default hardware configuration for a single controller. // If we have multiple controllers the settings must be set in the // users gfxconf.h file. + // Use the compiler include path to find it #include "gdisp_lld_config.h" // Unless the user has specified a specific pixel format, use diff --git a/src/gdisp/gdisp_colors.h b/src/gdisp/gdisp_colors.h index a097c702..8c72f9ac 100644 --- a/src/gdisp/gdisp_colors.h +++ b/src/gdisp/gdisp_colors.h @@ -19,7 +19,7 @@ #ifndef _GDISP_COLORS_H #define _GDISP_COLORS_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP || defined(__DOXYGEN__) diff --git a/src/gdisp/gdisp_driver.h b/src/gdisp/gdisp_driver.h index ced6756e..1912afd9 100644 --- a/src/gdisp/gdisp_driver.h +++ b/src/gdisp/gdisp_driver.h @@ -19,7 +19,7 @@ #if GFX_USE_GDISP // Include the GDRIVER infrastructure -#include "src/gdriver/gdriver.h" +#include "../gdriver/gdriver.h" // Are we currently compiling the driver itself? #if defined(GDISP_DRIVER_VMT) diff --git a/src/gdisp/gdisp_fonts.c b/src/gdisp/gdisp_fonts.c index 81df08ec..f1ef9e5d 100644 --- a/src/gdisp/gdisp_fonts.c +++ b/src/gdisp/gdisp_fonts.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_TEXT diff --git a/src/gdisp/gdisp_image.c b/src/gdisp/gdisp_image.c index 0319030f..853d2f75 100644 --- a/src/gdisp/gdisp_image.c +++ b/src/gdisp/gdisp_image.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_IMAGE diff --git a/src/gdisp/gdisp_image_bmp.c b/src/gdisp/gdisp_image_bmp.c index dd45081a..cc3235c0 100644 --- a/src/gdisp/gdisp_image_bmp.c +++ b/src/gdisp/gdisp_image_bmp.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_BMP diff --git a/src/gdisp/gdisp_image_gif.c b/src/gdisp/gdisp_image_gif.c index 515d67e8..0c1ba2c1 100644 --- a/src/gdisp/gdisp_image_gif.c +++ b/src/gdisp/gdisp_image_gif.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_GIF diff --git a/src/gdisp/gdisp_image_jpg.c b/src/gdisp/gdisp_image_jpg.c index 0f856e2c..9a10f215 100644 --- a/src/gdisp/gdisp_image_jpg.c +++ b/src/gdisp/gdisp_image_jpg.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_JPG diff --git a/src/gdisp/gdisp_image_native.c b/src/gdisp/gdisp_image_native.c index 347738bd..9ed0f664 100644 --- a/src/gdisp/gdisp_image_native.c +++ b/src/gdisp/gdisp_image_native.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_NATIVE diff --git a/src/gdisp/gdisp_image_png.c b/src/gdisp/gdisp_image_png.c index b6e70d91..9a3e3cf0 100644 --- a/src/gdisp/gdisp_image_png.c +++ b/src/gdisp/gdisp_image_png.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_IMAGE && GDISP_NEED_IMAGE_PNG diff --git a/src/gdisp/gdisp_pixmap.c b/src/gdisp/gdisp_pixmap.c index a725d547..c22ffcf0 100644 --- a/src/gdisp/gdisp_pixmap.c +++ b/src/gdisp/gdisp_pixmap.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDISP && GDISP_NEED_PIXMAP @@ -39,8 +39,8 @@ #error "GDISP Pixmap: Pixmap's do not currently support the specified GDISP_LLD_PIXELFORMAT" #endif -#include "src/gdisp/gdisp_driver.h" -#include "src/gdriver/gdriver.h" +#include "gdisp_driver.h" +#include "../gdriver/gdriver.h" typedef struct pixmap { #if GDISP_NEED_PIXMAP_IMAGE diff --git a/src/gdisp/mcufont/mf_config.h b/src/gdisp/mcufont/mf_config.h index 5c6f4ea9..3b76ee44 100644 --- a/src/gdisp/mcufont/mf_config.h +++ b/src/gdisp/mcufont/mf_config.h @@ -14,7 +14,7 @@ * Configuration settings related to GFX * *******************************************************/ -#include "gfx.h" +#include "../../../gfx.h" #if !GFX_USE_GDISP || !GDISP_NEED_TEXT #define MF_NO_COMPILE // Don't compile any font code diff --git a/src/gdriver/gdriver.c b/src/gdriver/gdriver.c index 116abd32..f59918d8 100644 --- a/src/gdriver/gdriver.c +++ b/src/gdriver/gdriver.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GDRIVER diff --git a/src/gevent/gevent.c b/src/gevent/gevent.c index bb57b3ad..46e643e9 100644 --- a/src/gevent/gevent.c +++ b/src/gevent/gevent.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GEVENT || defined(__DOXYGEN__) diff --git a/src/gevent/gevent.h b/src/gevent/gevent.h index a33fd84a..31e3e898 100644 --- a/src/gevent/gevent.h +++ b/src/gevent/gevent.h @@ -22,7 +22,7 @@ #ifndef _GEVENT_H #define _GEVENT_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GEVENT || defined(__DOXYGEN__) diff --git a/src/gfile/gfile.c b/src/gfile/gfile.c index 4c22e6cc..853b7455 100644 --- a/src/gfile/gfile.c +++ b/src/gfile/gfile.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE diff --git a/src/gfile/gfile.h b/src/gfile/gfile.h index 21a72e57..0ae2a035 100644 --- a/src/gfile/gfile.h +++ b/src/gfile/gfile.h @@ -19,7 +19,7 @@ #ifndef _GFILE_H #define _GFILE_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE || defined(__DOXYGEN__) diff --git a/src/gfile/gfile_fatfs_diskio_chibios.c b/src/gfile/gfile_fatfs_diskio_chibios.c index 319d1a86..a2e5fbaf 100644 --- a/src/gfile/gfile_fatfs_diskio_chibios.c +++ b/src/gfile/gfile_fatfs_diskio_chibios.c @@ -5,7 +5,7 @@ /* disk I/O modules and attach it to FatFs module with common interface. */ /*-----------------------------------------------------------------------*/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_FATFS && GFX_USE_OS_CHIBIOS diff --git a/src/gfile/gfile_fatfs_wrapper.c b/src/gfile/gfile_fatfs_wrapper.c index fb5e6ec2..01f5d26b 100644 --- a/src/gfile/gfile_fatfs_wrapper.c +++ b/src/gfile/gfile_fatfs_wrapper.c @@ -5,15 +5,15 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_FATFS #include "gfile_fatfs_wrapper.h" // Include the source we want -#include "3rdparty/fatfs-0.10b/src/ff.c" -#include "3rdparty/fatfs-0.10b/src/option/unicode.c" +#include "../../3rdparty/fatfs-0.10b/src/ff.c" +#include "../../3rdparty/fatfs-0.10b/src/option/unicode.c" // Extra operating system support #if _FS_REENTRANT diff --git a/src/gfile/gfile_fatfs_wrapper.h b/src/gfile/gfile_fatfs_wrapper.h index e66e13bc..463b4c2b 100644 --- a/src/gfile/gfile_fatfs_wrapper.h +++ b/src/gfile/gfile_fatfs_wrapper.h @@ -18,15 +18,15 @@ #include "ffconf.h" // Prevent preprocessor redefinition warnings -#include "3rdparty/fatfs-0.10b/src/integer.h" +#include "../../3rdparty/fatfs-0.10b/src/integer.h" #if defined(_T) && !defined(_INC_TCHAR) #define _INC_TCHAR #endif // Include the fatfs API -#include "3rdparty/fatfs-0.10b/src/ff.h" +#include "../../3rdparty/fatfs-0.10b/src/ff.h" // Include the fatfs diskio API -#include "3rdparty/fatfs-0.10b/src/diskio.h" +#include "../../3rdparty/fatfs-0.10b/src/diskio.h" #endif //_FATFS_WRAPPER diff --git a/src/gfile/gfile_fs_chibios.c b/src/gfile/gfile_fs_chibios.c index 9c3b156f..78681a90 100644 --- a/src/gfile/gfile_fs_chibios.c +++ b/src/gfile/gfile_fs_chibios.c @@ -9,7 +9,7 @@ * The ChibiOS FileStream file-system ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_CHIBIOSFS && GFX_USE_OS_CHIBIOS diff --git a/src/gfile/gfile_fs_fatfs.c b/src/gfile/gfile_fs_fatfs.c index c76b0659..d486e043 100644 --- a/src/gfile/gfile_fs_fatfs.c +++ b/src/gfile/gfile_fs_fatfs.c @@ -9,7 +9,7 @@ * The FATFS file-system ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_FATFS diff --git a/src/gfile/gfile_fs_mem.c b/src/gfile/gfile_fs_mem.c index 150220b8..4aad43fe 100644 --- a/src/gfile/gfile_fs_mem.c +++ b/src/gfile/gfile_fs_mem.c @@ -9,7 +9,7 @@ * The virtual memory file-system ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_MEMFS diff --git a/src/gfile/gfile_fs_native.c b/src/gfile/gfile_fs_native.c index db3cf02b..d1e2a1fc 100644 --- a/src/gfile/gfile_fs_native.c +++ b/src/gfile/gfile_fs_native.c @@ -12,7 +12,7 @@ // We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts #define GFILE_NEED_STDIO_MUST_BE_OFF -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_NATIVEFS diff --git a/src/gfile/gfile_fs_petitfs.c b/src/gfile/gfile_fs_petitfs.c index 443de42c..553c29ff 100644 --- a/src/gfile/gfile_fs_petitfs.c +++ b/src/gfile/gfile_fs_petitfs.c @@ -9,7 +9,7 @@ * The PETITFS file-system ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_PETITFS diff --git a/src/gfile/gfile_fs_ram.c b/src/gfile/gfile_fs_ram.c index f71eff6c..d159b32e 100644 --- a/src/gfile/gfile_fs_ram.c +++ b/src/gfile/gfile_fs_ram.c @@ -9,7 +9,7 @@ * The RAM file-system ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_RAMFS diff --git a/src/gfile/gfile_fs_rom.c b/src/gfile/gfile_fs_rom.c index 6b7719c7..ec07ec34 100644 --- a/src/gfile/gfile_fs_rom.c +++ b/src/gfile/gfile_fs_rom.c @@ -9,7 +9,7 @@ * The ROM file-system ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_ROMFS diff --git a/src/gfile/gfile_fs_strings.c b/src/gfile/gfile_fs_strings.c index 35c1575c..86c536d7 100644 --- a/src/gfile/gfile_fs_strings.c +++ b/src/gfile/gfile_fs_strings.c @@ -9,7 +9,7 @@ * The virtual string file ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_STRINGS diff --git a/src/gfile/gfile_petitfs_diskio_chibios.c b/src/gfile/gfile_petitfs_diskio_chibios.c index 7aa236ba..7708ac20 100644 --- a/src/gfile/gfile_petitfs_diskio_chibios.c +++ b/src/gfile/gfile_petitfs_diskio_chibios.c @@ -5,7 +5,7 @@ /* disk I/O modules and attach it to FatFs module with common interface. */ /*-----------------------------------------------------------------------*/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_PETITFS && GFX_USE_OS_CHIBIOS diff --git a/src/gfile/gfile_petitfs_wrapper.c b/src/gfile/gfile_petitfs_wrapper.c index b7bc0ee1..2536a180 100644 --- a/src/gfile/gfile_petitfs_wrapper.c +++ b/src/gfile/gfile_petitfs_wrapper.c @@ -5,13 +5,13 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_PETITFS #include "gfile_petitfs_wrapper.h" // Include the source we want -#include "3rdparty/petitfs-0.03/src/pff.c" +#include "../../3rdparty/petitfs-0.03/src/pff.c" #endif // GFX_USE_GFILE && GFILE_NEED_PETITFS diff --git a/src/gfile/gfile_petitfs_wrapper.h b/src/gfile/gfile_petitfs_wrapper.h index e9080b9e..dad89eea 100644 --- a/src/gfile/gfile_petitfs_wrapper.h +++ b/src/gfile/gfile_petitfs_wrapper.h @@ -18,9 +18,9 @@ #include "pffconf.h" // Include the petitfs API -#include "3rdparty/petitfs-0.03/src/pff.h" +#include "../../3rdparty/petitfs-0.03/src/pff.h" // Include the petitfs diskio API -#include "3rdparty/petitfs-0.03/src/diskio.h" +#include "../../3rdparty/petitfs-0.03/src/diskio.h" #endif //_PETITFS_WRAPPER diff --git a/src/gfile/gfile_printg.c b/src/gfile/gfile_printg.c index 5715a45a..8f9d2570 100644 --- a/src/gfile/gfile_printg.c +++ b/src/gfile/gfile_printg.c @@ -9,7 +9,7 @@ * Printg Routines ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_PRINTG diff --git a/src/gfile/gfile_scang.c b/src/gfile/gfile_scang.c index 5fac5ce3..a79cc6a3 100644 --- a/src/gfile/gfile_scang.c +++ b/src/gfile/gfile_scang.c @@ -9,7 +9,7 @@ * Scang Routines ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_SCANG diff --git a/src/gfile/gfile_stdio.c b/src/gfile/gfile_stdio.c index 0528547d..93270c3f 100644 --- a/src/gfile/gfile_stdio.c +++ b/src/gfile/gfile_stdio.c @@ -9,7 +9,7 @@ * Stdio Emulation Routines ********************************************************/ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GFILE && GFILE_NEED_STDIO && !defined(GFILE_NEED_STDIO_MUST_BE_OFF) diff --git a/src/gfx.c b/src/gfx.c index b4a28209..34526e6b 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -13,7 +13,7 @@ /* Display various warnings from gfx_rules.h */ #define GFX_DISPLAY_RULE_WARNINGS TRUE -#include "gfx.h" +#include "../gfx.h" static bool_t gfxInitDone = FALSE; diff --git a/src/ginput/ginput.c b/src/ginput/ginput.c index cf6377cf..af88e80c 100644 --- a/src/ginput/ginput.c +++ b/src/ginput/ginput.c @@ -12,7 +12,7 @@ * @addtogroup GINPUT * @{ */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GINPUT diff --git a/src/ginput/ginput.h b/src/ginput/ginput.h index 469a10d1..0aae5391 100644 --- a/src/ginput/ginput.h +++ b/src/ginput/ginput.h @@ -22,7 +22,7 @@ #ifndef _GINPUT_H #define _GINPUT_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GINPUT || defined(__DOXYGEN__) diff --git a/src/ginput/ginput_dial.c b/src/ginput/ginput_dial.c index 6c4f872b..0d853498 100644 --- a/src/ginput/ginput_dial.c +++ b/src/ginput/ginput_dial.c @@ -13,7 +13,7 @@ * @ingroup GINPUT * @{ */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GINPUT && GINPUT_NEED_DIAL diff --git a/src/ginput/ginput_driver_keyboard.h b/src/ginput/ginput_driver_keyboard.h index 62a00339..1e0c6c2a 100644 --- a/src/ginput/ginput_driver_keyboard.h +++ b/src/ginput/ginput_driver_keyboard.h @@ -20,7 +20,7 @@ #if GINPUT_NEED_KEYBOARD //|| defined(__DOXYGEN__) // Include the GDRIVER infrastructure -#include "src/gdriver/gdriver.h" +#include "../gdriver/gdriver.h" typedef struct GKeyboard { GDriver d; // The driver overheads and vmt diff --git a/src/ginput/ginput_driver_mouse.h b/src/ginput/ginput_driver_mouse.h index 93d01124..858d847a 100644 --- a/src/ginput/ginput_driver_mouse.h +++ b/src/ginput/ginput_driver_mouse.h @@ -20,7 +20,7 @@ #if GINPUT_NEED_MOUSE //|| defined(__DOXYGEN__) // Include the GDRIVER infrastructure -#include "src/gdriver/gdriver.h" +#include "../gdriver/gdriver.h" typedef struct GMouseReading { coord_t x, y, z; diff --git a/src/ginput/ginput_keyboard.c b/src/ginput/ginput_keyboard.c index 614cd525..0018dafb 100644 --- a/src/ginput/ginput_keyboard.c +++ b/src/ginput/ginput_keyboard.c @@ -13,7 +13,7 @@ // We need to include stdio.h below for MICROCODE_DEBUG. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts #define GFILE_NEED_STDIO_MUST_BE_OFF -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD diff --git a/src/ginput/ginput_keyboard_microcode.c b/src/ginput/ginput_keyboard_microcode.c index 9db0459b..c3e77d80 100644 --- a/src/ginput/ginput_keyboard_microcode.c +++ b/src/ginput/ginput_keyboard_microcode.c @@ -10,7 +10,7 @@ * @brief GINPUT keyboard standard microcode definitions. */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD && !GKEYBOARD_LAYOUT_OFF diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c index f149217d..58abfce2 100644 --- a/src/ginput/ginput_mouse.c +++ b/src/ginput/ginput_mouse.c @@ -9,7 +9,7 @@ * @file src/ginput/ginput_mouse.c * @brief GINPUT mouse/touch code. */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE diff --git a/src/ginput/ginput_options.h b/src/ginput/ginput_options.h index 3d3478d2..9fba51f9 100644 --- a/src/ginput/ginput_options.h +++ b/src/ginput/ginput_options.h @@ -157,17 +157,17 @@ #ifndef GINPUT_TOUCH_USER_CALIBRATION_SAVE #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE #endif - /** - * @brief Define multiple static mice - * @details When not defined the system automatically detects a single linked mouse driver - * @note The references to GMOUSEVMT_Win32 in the definition would be replaced - * by the names of the VMT for each of the static mice you want to - * include. - * @note Dynamic mice associated automatically with a display eg Win32, X or GFXnet - * do not need to be specified in this list as the associated display driver will register - * them automatically as the display is created. - */ #if defined(__DOXYGEN__) + /** + * @brief Define multiple static mice + * @details When not defined the system automatically detects a single linked mouse driver + * @note The references to GMOUSEVMT_Win32 in the definition would be replaced + * by the names of the VMT for each of the static mice you want to + * include. + * @note Dynamic mice associated automatically with a display eg Win32, X or GFXnet + * do not need to be specified in this list as the associated display driver will register + * them automatically as the display is created. + */ #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32 #endif /** @@ -178,17 +178,17 @@ #ifndef GINPUT_KEYBOARD_POLL_PERIOD #define GINPUT_KEYBOARD_POLL_PERIOD 200 #endif - /** - * @brief Define multiple static keyboards - * @details When not defined the system automatically detects a single linked keyboard driver - * @note The references to GKEYBOARDVMT_Win32 in the definition would be replaced - * by the names of the VMT for each of the static keyboards you want to - * include. - * @note Dynamic keyboards associated automatically with a display eg Win32, X or GFXnet - * do not need to be specified in this list as the display driver will register - * them automatically as the display is created. - */ #if defined(__DOXYGEN__) + /** + * @brief Define multiple static keyboards + * @details When not defined the system automatically detects a single linked keyboard driver + * @note The references to GKEYBOARDVMT_Win32 in the definition would be replaced + * by the names of the VMT for each of the static keyboards you want to + * include. + * @note Dynamic keyboards associated automatically with a display eg Win32, X or GFXnet + * do not need to be specified in this list as the display driver will register + * them automatically as the display is created. + */ #define GKEYBOARD_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32 #endif /** diff --git a/src/ginput/ginput_toggle.c b/src/ginput/ginput_toggle.c index 9ef945fa..eb65d6e0 100644 --- a/src/ginput/ginput_toggle.c +++ b/src/ginput/ginput_toggle.c @@ -13,7 +13,7 @@ * @ingroup GINPUT * @{ */ -#include "gfx.h" +#include "../../gfx.h" #if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) || defined(__DOXYGEN__) diff --git a/src/gmisc/gmisc.c b/src/gmisc/gmisc.c index 9bcc7bbe..99f06ff8 100644 --- a/src/gmisc/gmisc.c +++ b/src/gmisc/gmisc.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GMISC diff --git a/src/gmisc/gmisc.h b/src/gmisc/gmisc.h index 09fce40f..7ce91442 100644 --- a/src/gmisc/gmisc.h +++ b/src/gmisc/gmisc.h @@ -19,7 +19,7 @@ #ifndef _GMISC_H #define _GMISC_H -#include "gfx.h" +#include "../../gfx.h" /*===========================================================================*/ /* Type definitions */ diff --git a/src/gmisc/gmisc_arrayops.c b/src/gmisc/gmisc_arrayops.c index 350a787c..433e5d29 100644 --- a/src/gmisc/gmisc_arrayops.c +++ b/src/gmisc/gmisc_arrayops.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GMISC && GMISC_NEED_ARRAYOPS diff --git a/src/gmisc/gmisc_matrix2d.c b/src/gmisc/gmisc_matrix2d.c index 84b90c23..2cd162f2 100644 --- a/src/gmisc/gmisc_matrix2d.c +++ b/src/gmisc/gmisc_matrix2d.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GMISC diff --git a/src/gmisc/gmisc_trig.c b/src/gmisc/gmisc_trig.c index 12d06be2..0bf48846 100644 --- a/src/gmisc/gmisc_trig.c +++ b/src/gmisc/gmisc_trig.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GMISC diff --git a/src/gos/gos.h b/src/gos/gos.h index 4463740d..445e4b3a 100644 --- a/src/gos/gos.h +++ b/src/gos/gos.h @@ -457,27 +457,27 @@ * (without any of the documentation overheads) is in the files below. */ #elif GFX_USE_OS_RAWRTOS - #include "src/gos/gos_rawrtos.h" + #include "gos_rawrtos.h" #elif GFX_USE_OS_CHIBIOS - #include "src/gos/gos_chibios.h" + #include "gos_chibios.h" #elif GFX_USE_OS_FREERTOS - #include "src/gos/gos_freertos.h" + #include "gos_freertos.h" #elif GFX_USE_OS_WIN32 - #include "src/gos/gos_win32.h" + #include "gos_win32.h" #elif GFX_USE_OS_LINUX - #include "src/gos/gos_linux.h" + #include "gos_linux.h" #elif GFX_USE_OS_OSX - #include "src/gos/gos_osx.h" + #include "gos_osx.h" #elif GFX_USE_OS_RAW32 - #include "src/gos/gos_raw32.h" + #include "gos_raw32.h" #elif GFX_USE_OS_ECOS - #include "src/gos/gos_ecos.h" + #include "gos_ecos.h" #elif GFX_USE_OS_ARDUINO - #include "src/gos/gos_arduino.h" + #include "gos_arduino.h" #elif GFX_USE_OS_CMSIS - #include "src/gos/gos_cmsis.h" + #include "gos_cmsis.h" #elif GFX_USE_OS_KEIL - #include "src/gos/gos_keil.h" + #include "gos_keil.h" #else #error "Your operating system is not supported yet" #endif diff --git a/src/gos/gos_arduino.c b/src/gos/gos_arduino.c index c565abb9..726c57db 100644 --- a/src/gos/gos_arduino.c +++ b/src/gos/gos_arduino.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_ARDUINO diff --git a/src/gos/gos_chibios.c b/src/gos/gos_chibios.c index d650caa0..c23155ca 100644 --- a/src/gos/gos_chibios.c +++ b/src/gos/gos_chibios.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_CHIBIOS diff --git a/src/gos/gos_cmsis.c b/src/gos/gos_cmsis.c index ea4a6599..1422fd90 100644 --- a/src/gos/gos_cmsis.c +++ b/src/gos/gos_cmsis.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #include #if GFX_USE_OS_CMSIS diff --git a/src/gos/gos_ecos.c b/src/gos/gos_ecos.c index b3476b22..771ac389 100644 --- a/src/gos/gos_ecos.c +++ b/src/gos/gos_ecos.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_ECOS diff --git a/src/gos/gos_freertos.c b/src/gos/gos_freertos.c index 227caf31..c1c9c16a 100644 --- a/src/gos/gos_freertos.c +++ b/src/gos/gos_freertos.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #include #if GFX_USE_OS_FREERTOS diff --git a/src/gos/gos_linux.c b/src/gos/gos_linux.c index 52f983b2..1e0675dd 100644 --- a/src/gos/gos_linux.c +++ b/src/gos/gos_linux.c @@ -8,7 +8,7 @@ // We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts #define GFILE_NEED_STDIO_MUST_BE_OFF -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_LINUX diff --git a/src/gos/gos_osx.c b/src/gos/gos_osx.c index f0c2b4cd..413ddc62 100644 --- a/src/gos/gos_osx.c +++ b/src/gos/gos_osx.c @@ -8,7 +8,7 @@ // We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts #define GFILE_NEED_STDIO_MUST_BE_OFF -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_OSX diff --git a/src/gos/gos_raw32.c b/src/gos/gos_raw32.c index 4e61feb9..2b482ae2 100644 --- a/src/gos/gos_raw32.c +++ b/src/gos/gos_raw32.c @@ -8,7 +8,7 @@ // We need to include stdio.h below for Win32 emulation. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts #define GFILE_NEED_STDIO_MUST_BE_OFF -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_RAW32 diff --git a/src/gos/gos_rawrtos.c b/src/gos/gos_rawrtos.c index a33c49b3..7c24cd5a 100644 --- a/src/gos/gos_rawrtos.c +++ b/src/gos/gos_rawrtos.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_RAWRTOS diff --git a/src/gos/gos_win32.c b/src/gos/gos_win32.c index 8e769aab..e9abedd7 100644 --- a/src/gos/gos_win32.c +++ b/src/gos/gos_win32.c @@ -8,7 +8,7 @@ // We need to include stdio.h below. Turn off GFILE_NEED_STDIO just for this file to prevent conflicts #define GFILE_NEED_STDIO_MUST_BE_OFF -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_OS_WIN32 diff --git a/src/gos/gos_x_heap.c b/src/gos/gos_x_heap.c index e8faa02f..cd78f403 100644 --- a/src/gos/gos_x_heap.c +++ b/src/gos/gos_x_heap.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GOS_NEED_X_HEAP diff --git a/src/gos/gos_x_threads.c b/src/gos/gos_x_threads.c index 76637322..51f5936b 100644 --- a/src/gos/gos_x_threads.c +++ b/src/gos/gos_x_threads.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GOS_NEED_X_THREADS diff --git a/src/gqueue/gqueue.c b/src/gqueue/gqueue.c index 1205143f..e9143654 100644 --- a/src/gqueue/gqueue.c +++ b/src/gqueue/gqueue.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GQUEUE diff --git a/src/gtimer/gtimer.c b/src/gtimer/gtimer.c index e3262ec1..dc177f7e 100644 --- a/src/gtimer/gtimer.c +++ b/src/gtimer/gtimer.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GTIMER || defined(__DOXYGEN__) diff --git a/src/gtimer/gtimer.h b/src/gtimer/gtimer.h index 6803ac66..db740e1c 100644 --- a/src/gtimer/gtimer.h +++ b/src/gtimer/gtimer.h @@ -29,7 +29,7 @@ #ifndef _GTIMER_H #define _GTIMER_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GTIMER || defined(__DOXYGEN__) diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 07beb996..f448453b 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN diff --git a/src/gwin/gwin.h b/src/gwin/gwin.h index a9fc4ca3..5912046b 100644 --- a/src/gwin/gwin.h +++ b/src/gwin/gwin.h @@ -25,7 +25,7 @@ #ifndef _GWIN_H #define _GWIN_H -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN || defined(__DOXYGEN__) diff --git a/src/gwin/gwin_button.c b/src/gwin/gwin_button.c index 75327b8b..6e25ab6c 100644 --- a/src/gwin/gwin_button.c +++ b/src/gwin/gwin_button.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system button code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_BUTTON diff --git a/src/gwin/gwin_checkbox.c b/src/gwin/gwin_checkbox.c index e0115608..43d74f23 100644 --- a/src/gwin/gwin_checkbox.c +++ b/src/gwin/gwin_checkbox.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system button code */ -#include "gfx.h" +#include "../../gfx.h" #if (GFX_USE_GWIN && GWIN_NEED_CHECKBOX) || defined(__DOXYGEN__) diff --git a/src/gwin/gwin_console.c b/src/gwin/gwin_console.c index 06f7214f..667ec560 100644 --- a/src/gwin/gwin_console.c +++ b/src/gwin/gwin_console.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system console code. */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_CONSOLE diff --git a/src/gwin/gwin_container.c b/src/gwin/gwin_container.c index 89d09e9a..f680f6fb 100644 --- a/src/gwin/gwin_container.c +++ b/src/gwin/gwin_container.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system container code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_CONTAINERS diff --git a/src/gwin/gwin_frame.c b/src/gwin/gwin_frame.c index 7400b0f5..28d7c01d 100644 --- a/src/gwin/gwin_frame.c +++ b/src/gwin/gwin_frame.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system frame code. */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_FRAME diff --git a/src/gwin/gwin_gl3d.c b/src/gwin/gwin_gl3d.c index 6e16479e..c9db1a3b 100644 --- a/src/gwin/gwin_gl3d.c +++ b/src/gwin/gwin_gl3d.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system button code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_GL3D @@ -20,7 +20,7 @@ #include "gwin_class.h" -#include "3rdparty/tinygl-0.4-ugfx/src/zgl.h" +#include "../../3rdparty/tinygl-0.4-ugfx/src/zgl.h" // Forward definitions static void gl3dDestroy(GWindowObject *gh); @@ -147,25 +147,25 @@ void *gl_zalloc(int size) { * TinyGL wrapper code */ -#include "3rdparty/tinygl-0.4-ugfx/src/api.c" -#include "3rdparty/tinygl-0.4-ugfx/src/list.c" -#include "3rdparty/tinygl-0.4-ugfx/src/vertex.c" -#include "3rdparty/tinygl-0.4-ugfx/src/init.c" -#include "3rdparty/tinygl-0.4-ugfx/src/matrix.c" -#include "3rdparty/tinygl-0.4-ugfx/src/texture.c" -#include "3rdparty/tinygl-0.4-ugfx/src/misc.c" -#include "3rdparty/tinygl-0.4-ugfx/src/clear.c" -#include "3rdparty/tinygl-0.4-ugfx/src/light.c" -#include "3rdparty/tinygl-0.4-ugfx/src/clip.c" -#include "3rdparty/tinygl-0.4-ugfx/src/select.c" -#include "3rdparty/tinygl-0.4-ugfx/src/get.c" -#include "3rdparty/tinygl-0.4-ugfx/src/zbuffer.c" -#include "3rdparty/tinygl-0.4-ugfx/src/zline.c" -#include "3rdparty/tinygl-0.4-ugfx/src/zdither.c" -#include "3rdparty/tinygl-0.4-ugfx/src/ztriangle.c" -#include "3rdparty/tinygl-0.4-ugfx/src/zmath.c" -#include "3rdparty/tinygl-0.4-ugfx/src/image_util.c" -#include "3rdparty/tinygl-0.4-ugfx/src/arrays.c" -#include "3rdparty/tinygl-0.4-ugfx/src/specbuf.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/api.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/list.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/vertex.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/init.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/matrix.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/texture.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/misc.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/clear.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/light.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/clip.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/select.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/get.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/zbuffer.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/zline.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/zdither.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/ztriangle.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/zmath.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/image_util.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/arrays.c" +#include "../../3rdparty/tinygl-0.4-ugfx/src/specbuf.c" #endif /* GFX_USE_GWIN && GWIN_NEED_GL3D */ diff --git a/src/gwin/gwin_gl3d.h b/src/gwin/gwin_gl3d.h index b04d49a6..52330029 100644 --- a/src/gwin/gwin_gl3d.h +++ b/src/gwin/gwin_gl3d.h @@ -62,7 +62,7 @@ GHandle gwinGGL3DCreate(GDisplay *g, GGL3DObject *gg, const GWindowInit *pInit); #define gwinGL3DCreate(gg, pInit) gwinGGL3DCreate(GDISP, gg, pInit) /* Include the gl interface */ -#include "3rdparty/tinygl-0.4-ugfx/include/GL/gl.h" +#include "../../3rdparty/tinygl-0.4-ugfx/include/GL/gl.h" #ifdef __cplusplus } diff --git a/src/gwin/gwin_graph.c b/src/gwin/gwin_graph.c index 8a450a9f..95743ced 100644 --- a/src/gwin/gwin_graph.c +++ b/src/gwin/gwin_graph.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system button code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_GRAPH diff --git a/src/gwin/gwin_image.c b/src/gwin/gwin_image.c index 89cb79aa..900e7f61 100644 --- a/src/gwin/gwin_image.c +++ b/src/gwin/gwin_image.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system image code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_IMAGE diff --git a/src/gwin/gwin_keyboard.c b/src/gwin/gwin_keyboard.c index 34a61a1a..7080cd5d 100644 --- a/src/gwin/gwin_keyboard.c +++ b/src/gwin/gwin_keyboard.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system virtual keyboard code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_KEYBOARD diff --git a/src/gwin/gwin_keyboard_layout.c b/src/gwin/gwin_keyboard_layout.c index 05e08165..ee665900 100644 --- a/src/gwin/gwin_keyboard_layout.c +++ b/src/gwin/gwin_keyboard_layout.c @@ -5,7 +5,7 @@ * http://ugfx.org/license.html */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_KEYBOARD diff --git a/src/gwin/gwin_label.c b/src/gwin/gwin_label.c index 97311a3e..e6b4e986 100644 --- a/src/gwin/gwin_label.c +++ b/src/gwin/gwin_label.c @@ -10,7 +10,7 @@ * @brief GWIN label widget header file */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_LABEL diff --git a/src/gwin/gwin_list.c b/src/gwin/gwin_list.c index 1febf019..4bb9c283 100644 --- a/src/gwin/gwin_list.c +++ b/src/gwin/gwin_list.c @@ -10,7 +10,7 @@ * @brief GWIN list widget header file */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_LIST diff --git a/src/gwin/gwin_progressbar.c b/src/gwin/gwin_progressbar.c index 0de69867..be8de700 100644 --- a/src/gwin/gwin_progressbar.c +++ b/src/gwin/gwin_progressbar.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system progressbar code */ -#include "gfx.h" +#include "../../gfx.h" #if (GFX_USE_GWIN && GWIN_NEED_PROGRESSBAR) || defined(__DOXYGEN__) diff --git a/src/gwin/gwin_radio.c b/src/gwin/gwin_radio.c index 470a1f2a..9b9f589b 100644 --- a/src/gwin/gwin_radio.c +++ b/src/gwin/gwin_radio.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system radio button code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_RADIO diff --git a/src/gwin/gwin_slider.c b/src/gwin/gwin_slider.c index c8f47f95..613b225d 100644 --- a/src/gwin/gwin_slider.c +++ b/src/gwin/gwin_slider.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system slider code */ -#include "gfx.h" +#include "../../gfx.h" #if (GFX_USE_GWIN && GWIN_NEED_SLIDER) || defined(__DOXYGEN__) diff --git a/src/gwin/gwin_tabset.c b/src/gwin/gwin_tabset.c index d059256d..148a0bb1 100644 --- a/src/gwin/gwin_tabset.c +++ b/src/gwin/gwin_tabset.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system tabset code. */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_TABSET diff --git a/src/gwin/gwin_textedit.c b/src/gwin/gwin_textedit.c index e0470350..7de57336 100644 --- a/src/gwin/gwin_textedit.c +++ b/src/gwin/gwin_textedit.c @@ -10,7 +10,7 @@ * @brief GWIN TextEdit widget header file */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_TEXTEDIT diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c index a97e170a..3180931d 100644 --- a/src/gwin/gwin_widget.c +++ b/src/gwin/gwin_widget.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system widget code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_WIDGET diff --git a/src/gwin/gwin_wm.c b/src/gwin/gwin_wm.c index ef7333fa..6bc5013b 100644 --- a/src/gwin/gwin_wm.c +++ b/src/gwin/gwin_wm.c @@ -10,7 +10,7 @@ * @brief GWIN sub-system window manager code */ -#include "gfx.h" +#include "../../gfx.h" #if GFX_USE_GWIN && !GWIN_NEED_WINDOWMANAGER /** -- cgit v1.2.3