-
Notifications
You must be signed in to change notification settings - Fork 87
Description
HI,
I have many error when I am compile example code:
my code is:
`
//This example shows how to animate graphics on a VGA screen. No backbuffering is used... just try it.
//You need to connect a VGA screen cable and an external DAC (simple R2R does the job) to the pins specified below.
//cc by-sa 4.0 license
//bitluni
#include <ESP32Lib.h>
#include <Ressources/Font6x8.h>
#include <math.h>
//pin configuration
const int redPins[] = {2, 4, 12, 13, 14};
const int greenPins[] = {15, 16, 17, 18, 19};
const int bluePins[] = {21, 22, 23, 27};
const int hsyncPin = 32;
const int vsyncPin = 33;
//VGA Device
VGA14Bit vga;
//initial setup
void setup()
{
//initializing i2s vga (with only one framebuffer)
vga.init(vga.MODE200x150, redPins, greenPins, bluePins, hsyncPin, vsyncPin);
//setting the font
vga.setFont(Font6x8);
}
//the loop is done every frame
void loop()
{
//setting the text cursor to the lower left corner of the screen
vga.setCursor(0, vga.yres - 8);
//setting the text color to white with opaque black background
vga.setTextColor(vga.RGB(0xffffff), vga.RGBA(0, 0, 0, 255));
//printing the fps
vga.print("fps: ");
static long f = 0;
vga.print(long((f++ * 1000) / millis()));
//circle parameters
float factors[][2] = {{1, 1.1f}, {0.9f, 1.02f}, {1.1, 0.8}};
int colors[] = {vga.RGB(0xff0000), vga.RGB(0x00ff00), vga.RGB(0x0000ff)};
//animate them with milliseconds
float p = millis() * 0.002f;
for (int i = 0; i < 3; i++)
{
//calculate the position
int x = vga.xres / 2 + sin(p * factors[i][0]) * vga.xres / 3;
int y = vga.yres / 2 + cos(p * factors[i][1]) * vga.yres / 3;
//clear the center with a black filled circle
vga.fillCircle(x, y, 8, 0);
//draw the circle with the color from the array
vga.circle(x, y, 10, colors[i]);
}
//render the flame effect
for (int y = 0; y < vga.yres - 9; y++)
for (int x = 1; x < vga.xres - 1; x++)
{
//take the avarage from the surrounding pixels below
int c0 = vga.get(x, y);
int c1 = vga.get(x, y + 1);
int c2 = vga.get(x - 1, y + 1);
int c3 = vga.get(x + 1, y + 1);
int r = ((c0 & 0x1f) + (c1 & 0x1f) + ((c2 & 0x1f) + (c3 & 0x1f)) / 2) / 3;
int g = (((c0 & 0x3e0) + (c1 & 0x3e0) + ((c2 & 0x3e0) + (c3 & 0x3e0)) / 2) / 3) & 0x3e0;
int b = (((c0 & 0x3c00) + (c1 & 0x3c00) + ((c2 & 0x3c00) + (c3 & 0x3c00)) / 2) / 3) & 0x3c00;
//draw the new pixel
vga.dotFast(x, y, r | g | b);
}
}
`
and errors:
*In file included from i:\project\Arduino\libraries\bitluni_ESP32Lib\src/ESP32Lib.h:21,
from C:\Users\Emidn\AppData\Local\Temp.arduinoIDE-unsaved2024525-2624-jtsgbq.otm7\sketch_jun25k\sketch_jun25k.ino:6:
i:\project\Arduino\libraries\bitluni_ESP32Lib\src/Audio/AudioOutput.h: In member function 'void AudioOutput::init(AudioSystem&)':
i:\project\Arduino\libraries\bitluni_ESP32Lib\src/Audio/AudioOutput.h:39:110: error: 'TIMER_BASE_CLK' was not declared in this scope
39 | timer_set_alarm_value((timer_group_t)TIMER_GROUP_0, (timer_idx_t)TIMER_0, 1.0/audioSystem.samplingRate * TIMER_BASE_CLK / config.divider);
| ^~~~~~~~~~~~~~
i:\project\Arduino\libraries\bitluni_ESP32Lib\src/Audio/AudioOutput.h: In function 'void timerInterrupt(AudioOutput)':
i:\project\Arduino\libraries\bitluni_ESP32Lib\src/Audio/AudioOutput.h:51:42: error: no match for 'operator=' (operand types are 'volatile timg_txupdate_reg_t' and 'int')
51 | TIMERG0.hw_timer[TIMER_0].update = 1;
| ^
In file included from i:\project\Arduino\libraries\bitluni_ESP32Lib\src/Audio/AudioOutput.h:13:
C:\Users\Emidn\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-442a798083\esp32/include/soc/esp32/include/soc/timer_group_struct.h:98:3: note: candidate: 'constexpr timg_txupdate_reg_t& timg_txupdate_reg_t::operator=(timg_txupdate_reg_t&&)'
98 | } timg_txupdate_reg_t;
| ^~~~~~~~~~~~~~~~~~~
C:\Users\Emidn\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-442a798083\esp32/include/soc/esp32/include/soc/timer_group_struct.h:98:3: note: no known conversion for argument 1 from 'int' to 'timg_txupdate_reg_t&&'
C:\Users\Emidn\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-442a798083\esp32/include/soc/esp32/include/soc/timer_group_struct.h:98:3: note: candidate: 'constexpr timg_txupdate_reg_t& timg_txupdate_reg_t::operator=(const timg_txupdate_reg_t&)'
C:\Users\Emidn\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-442a798083\esp32/include/soc/esp32/include/soc/timer_group_struct.h:98:3: note: no known conversion for argument 1 from 'int' to 'const timg_txupdate_reg_t&'
i:\project\Arduino\libraries\bitluni_ESP32Lib\src/Audio/AudioOutput.h:52:30: error: 'volatile union timg_int_clr_timers_reg_t' has no member named 't0'
52 | TIMERG0.int_clr_timers.t0 = 1;
| ^~
i:\project\Arduino\libraries\bitluni_ESP32Lib\src/Audio/AudioOutput.h:53:40: error: 'volatile union timg_txconfig_reg_t' has no member named 'alarm_en'
53 | TIMERG0.hw_timer[TIMER_0].config.alarm_en = 1;
| ^~~~~~~~
exit status 1
Compilation error: exit status 1**
it's about Audio timer, what's my problem?
Regards.