Compare commits

..

No commits in common. "48bf4a29d4fe5b1e924ca0867f9109e4ac582c55" and "9d8653b528ccaf36aa5f6dfb80f4d0157d01cc26" have entirely different histories.

4 changed files with 19 additions and 18 deletions

View File

@ -9,6 +9,4 @@ Sorry.
## Manual
User instructions can be found at trueControl BASIC:
* https://basic.truecontrol.org/database/dc32/retro-tech-gat/
Firmware is a MounRiver Studio project. You can freely download MounRiver Studio at http://mounriver.com/download
* https://basic.truecontrol.org/database/dc32/retro-tech-gat/

View File

@ -53,24 +53,26 @@ volatile uint32_t uptime;
void SysTick_Handler(void)
{
if (++ticnt > 0x1ff) {
if (++ticnt > 0x7ff) {
ticnt = 0;
uptime++;
}
// send new LEDs (1/128 duty)
if ((ticnt & 0x3) == 0) {
if ((ticnt & 0xf) == 3) {
led_send();
}
// process buttons (1/512 duty)
btn_poll();
if ((ticnt & 0x3) == 0) {
btn_poll();
}
// process ADC (1/256 duty)
if ((ticnt & 0x1) == 0) {
if ((ticnt & 0x07) == 1) {
adc_convert();
}
if ((ticnt & 0x1) == 1) {
if ((ticnt & 0x07) == 2) {
adc_read();
}

View File

@ -30,7 +30,7 @@
void systick_init(void)
{
SysTick->CMP = (SystemCoreClock / 512) - 1; // we want a 512Hz interrupt
SysTick->CMP = (SystemCoreClock / 2048) - 1; // we want a 2048Hz interrupt
SysTick->CNT = 0; // clear counter
SysTick->CTLR = 0xF; // start counter in /1 mode, enable interrupts, auto-reset counter
SysTick->SR = 0; // clear count comparison flag
@ -82,6 +82,13 @@ void gpio_init()
GPIO_Init(GPIOC, &gpio);
}
/*********************************************************************
* @fn main
*
* @brief Main program.
*
* @return none
*/
int main(void)
{
// configure core
@ -119,10 +126,10 @@ int main(void)
while(1) {
__WFI();
// after sending LEDs, run LED render program
// after sending LEDs, run our program
// to update the LED buffer for next time
// we have approx 7ms to render... plenty of time
if ((ticnt & 0x3) == 0) {
if ((ticnt & 0xf) == 3) {
ui_render();
}
}

View File

@ -291,7 +291,7 @@ void ui_btn_release_cb(uint8_t idx)
}
}
static void ui_cursor_flash()
void ui_cursor_flash()
{
uint8_t color, flash;
uint8_t level = 0;
@ -479,9 +479,6 @@ void ui_render()
// always postpone config saving
config_save_timer = UI_CONF_SAVE_TIMEOUT;
// always increase brightness of LEDs while editing
is31fl3729_set_global_current(FL3729_ADDR, FL3729_GCC_MAX);
// always force rendering
led_is_updated();
@ -513,9 +510,6 @@ void ui_render()
// always postpone config saving
config_save_timer = UI_CONF_SAVE_TIMEOUT;
// always increase brightness of LEDs while editing
is31fl3729_set_global_current(FL3729_ADDR, FL3729_GCC_MAX);
// always force rendering
led_is_updated();