Rework disk LED activity.
This commit is contained in:
@@ -4,9 +4,6 @@
|
||||
#ifndef FPGAIO_H
|
||||
#define FPGAIO_H
|
||||
|
||||
#define DISKLED_ON fpga_set_led(1)
|
||||
#define DISKLED_OFF fpga_set_led(0)
|
||||
|
||||
#define BUTTON_OSD 1
|
||||
#define BUTTON_USR 2
|
||||
|
||||
|
||||
35
input.cpp
35
input.cpp
@@ -2655,18 +2655,12 @@ int input_test(int getchar)
|
||||
state++;
|
||||
}
|
||||
|
||||
static unsigned long led_to = 0;
|
||||
|
||||
if (state == 2)
|
||||
{
|
||||
int timeout = 0, extrapoll = 2;
|
||||
if (is_menu_core() && video_fb_state())
|
||||
{
|
||||
timeout = 25;
|
||||
if (pool[NUMDEV + 2].fd > 0) extrapoll = 3;
|
||||
}
|
||||
int timeout = 0;
|
||||
if (is_menu_core() && video_fb_state()) timeout = 25;
|
||||
|
||||
int return_value = poll(pool, NUMDEV + extrapoll, timeout);
|
||||
int return_value = poll(pool, NUMDEV + 3, timeout);
|
||||
if (return_value < 0)
|
||||
{
|
||||
printf("ERR: poll\n");
|
||||
@@ -3040,23 +3034,9 @@ int input_test(int getchar)
|
||||
|
||||
if ((pool[NUMDEV + 2].fd >= 0) && (pool[NUMDEV + 2].revents & POLLPRI))
|
||||
{
|
||||
//printf("revents = %x\n", pool[NUMDEV + 2].revents);
|
||||
pool[NUMDEV + 2].revents = 0;
|
||||
|
||||
static char status[16];
|
||||
int len = read(pool[NUMDEV + 2].fd, status, sizeof(status) - 1);
|
||||
if (read(pool[NUMDEV + 2].fd, status, sizeof(status) - 1) && status[0] != '0') DISKLED_ON;
|
||||
lseek(pool[NUMDEV + 2].fd, 0, SEEK_SET);
|
||||
if (len)
|
||||
{
|
||||
status[len] = 0;
|
||||
//printf("led: %s", status);
|
||||
if (status[0] != '0' && is_menu_core() && video_fb_state())
|
||||
{
|
||||
//printf("led: on\n");
|
||||
if (!led_to) user_io_8bit_set_status(0x80, 0x80);
|
||||
led_to = GetTimer(40);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3085,13 +3065,6 @@ int input_test(int getchar)
|
||||
}
|
||||
}
|
||||
|
||||
if (led_to && CheckTimer(led_to))
|
||||
{
|
||||
//printf("led: off\n");
|
||||
led_to = 0;
|
||||
user_io_8bit_set_status(0, 0x80);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
9
menu.cpp
9
menu.cpp
@@ -2247,8 +2247,9 @@ void HandleUI(void)
|
||||
OsdDrawLogo(3);
|
||||
OsdDrawLogo(4);
|
||||
|
||||
OsdWrite(10, " www.MiSTerFPGA.org");
|
||||
sprintf(s, " MiSTer v%s", version + 5);
|
||||
OsdWrite(10, s, 0, 0, 1);
|
||||
OsdWrite(12, s, 0, 0, 1);
|
||||
|
||||
s[0] = 0;
|
||||
if (user_io_core_type() != CORE_TYPE_MINIMIG2)
|
||||
@@ -2262,11 +2263,9 @@ void HandleUI(void)
|
||||
for (int i = 0; i < len; i++) *s2++ = *s3++;
|
||||
*s2++ = 0;
|
||||
}
|
||||
OsdWrite(11, s, 0, 0, 1);
|
||||
OsdWrite(12, "", 0, 0, 1);
|
||||
ScrollText(13, " MiSTer by Sorgelig, based on MiST by Till Harbaum, Minimig by Dennis van Weeren and other projects. MiSTer hardware and software is distributed under the terms of the GNU General Public License version 3. MiSTer FPGA cores are the work of their respective authors under individual licensing.", 0, 0, 0, 0);
|
||||
OsdWrite(13, s, 0, 0, 1);
|
||||
OsdWrite(14, "", 0, 0, 1);
|
||||
OsdWrite(15, "", 0, 0, 1);
|
||||
ScrollText(15, " MiSTer by Sorgelig, based on MiST by Till Harbaum, Minimig by Dennis van Weeren and other projects. MiSTer hardware and software is distributed under the terms of the GNU General Public License version 3. MiSTer FPGA cores are the work of their respective authors under individual licensing. Go to www.MiSTerFPGA.org for more details.", 0, 0, 0, 0);
|
||||
|
||||
if (menu | select | left)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "minimig_fdd.h"
|
||||
#include "minimig_config.h"
|
||||
#include "../../debug.h"
|
||||
#include "../../fpga_io.h"
|
||||
#include "../../user_io.h"
|
||||
#include "../../menu.h"
|
||||
|
||||
unsigned char drives = 0; // number of active drives reported by FPGA (may change only during reset)
|
||||
|
||||
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "../../menu.h"
|
||||
#include "minimig_config.h"
|
||||
#include "../../debug.h"
|
||||
#include "../../fpga_io.h"
|
||||
#include "../../user_io.h"
|
||||
|
||||
#define CMD_IDECMD 0x04
|
||||
#define CMD_IDEDAT 0x08
|
||||
|
||||
16
user_io.cpp
16
user_io.cpp
@@ -1574,9 +1574,9 @@ void user_io_send_buttons(char force)
|
||||
|
||||
static uint32_t diskled_timer = 0;
|
||||
static uint32_t diskled_is_on = 0;
|
||||
void __inline diskled_on()
|
||||
void diskled_on()
|
||||
{
|
||||
DISKLED_ON;
|
||||
fpga_set_led(1);
|
||||
diskled_timer = GetTimer(50);
|
||||
diskled_is_on = 1;
|
||||
}
|
||||
@@ -1910,12 +1910,6 @@ void user_io_poll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(diskled_is_on && CheckTimer(diskled_timer))
|
||||
{
|
||||
DISKLED_OFF;
|
||||
diskled_is_on = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (core_type == CORE_TYPE_8BIT && !is_menu_core())
|
||||
@@ -2195,6 +2189,12 @@ void user_io_poll()
|
||||
vol_set_timeout = 0;
|
||||
FileSaveConfig("Volume.dat", &vol_att, 1);
|
||||
}
|
||||
|
||||
if (diskled_is_on && CheckTimer(diskled_timer))
|
||||
{
|
||||
fpga_set_led(0);
|
||||
diskled_is_on = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void send_keycode(unsigned short key, int press)
|
||||
|
||||
Reference in New Issue
Block a user