-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexey Presniakov
committed
Apr 7, 2018
1 parent
4f43917
commit a39fa8b
Showing
18 changed files
with
712 additions
and
16 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
http://www.computer-museum.ru/technlgy/8bitproc.htm | ||
https://github.com/pvvx/MinEspSDKLib | ||
https://github.com/cnlohr/MinEspSDKLib | ||
http://www.danbigras.ru/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
#include "help.h" | ||
|
||
#include "ets.h" | ||
#include "vg75.h" | ||
#include "ui.h" | ||
#include "ps2.h" | ||
#include "ps2_codes.h" | ||
|
||
|
||
#define HELP_AT 0x50000 | ||
|
||
|
||
static int n_lines=-1, line=0; | ||
|
||
|
||
static void display(void) | ||
{ | ||
int addr=0; | ||
|
||
// þÉÔÁÅÍ ÁÄÒÅÓ ÐÅÒ×ÏÊ ×ÉÄÉÍÏÊ ÓÔÒÏËÉ | ||
if (line != 0) | ||
{ | ||
uint16_t tmp[2]; | ||
SPIRead(HELP_AT+(line & 0xFFFE)*2, (uint32_t*)tmp, 4); // ÞÔÅÎÉÅ ÄÏÌÖÎÏ ÂÙÔØ ×ÙÒÁ×ÎÅÎÏ ÐÏ ÇÒÁÎÉÃÅ 4 ÂÁÊÔ | ||
addr=tmp[line & 1]; | ||
} | ||
|
||
// äÏÂÁ×ÌÑÅÍ ÓÍÅÝÅÎÉÅ ÔÁÂÌÉÃÙ ÓÔÒÏË É ÁÄÒÅÓ ÎÁÞÁÌÁ ×Ï ÆÌÜÛÅ | ||
addr+=n_lines*2 + HELP_AT; | ||
//ets_printf("HELP: display start 0x%05X\n", addr); | ||
|
||
// òÉÓÕÅÍ ÓÔÒÏËÉ | ||
int i; | ||
for (i=0; i<30; i++) | ||
{ | ||
// ðÒÏ×ÅÒÑÅÍ ÎÁ ËÏÎÅà ÔÅËÓÔÁ | ||
if (line+i >= n_lines) break; | ||
|
||
//ets_printf("HELP: line %d at 0x%05X\n", line+i, addr); | ||
|
||
// þÉÔÁÅÍ ÔÅËÓÔ × ÂÕÆÅÒ | ||
uint8_t buf[80]; // ÍÁËÓ. ÄÌÉÎÁ - 72 ÓÉÍ×ÏÌÁ + ÎÁ ×ÙÒÁ×ÎÉ×ÁÎÉÅ ÐÏ ÇÒÁÎÉÃÅ 4 ÂÁÊÔ | ||
SPIRead(addr & ~0x03, (uint32_t*)buf, sizeof(buf)); | ||
uint8_t o=addr & 0x03; | ||
uint8_t x=8; | ||
while (buf[o]) | ||
{ | ||
ui_scr[4+i][x++]=buf[o++]; | ||
addr++; | ||
} | ||
|
||
// ïÞÉÝÁÅÍ ÏÓÔÁÔÏË ÓÔÒÏËÉ | ||
while (x < 80) | ||
ui_scr[4+i][x++]=0; | ||
|
||
addr++; // ËÏÎÅÃ ÓÔÒÏËÉ | ||
} | ||
} | ||
|
||
|
||
void help_display(void) | ||
{ | ||
ui_start(); | ||
|
||
// þÉÔÁÅÍ ËÏÌ-×Ï ÓÔÒÏË (ÅÓÌÉ ÎÅ ÞÉÔÁÌÉ ÅÝÅ) | ||
if (n_lines < 0) | ||
{ | ||
uint16_t tmp[2]; | ||
|
||
SPIRead(HELP_AT, (uint32_t*)tmp, 4); | ||
n_lines=tmp[0]; | ||
//ets_printf("HELP: n_lines=%d\n", n_lines); | ||
} | ||
|
||
draw: | ||
// òÉÓÕÅÍ ÎÁ ÜËÒÁÎÅ | ||
display(); | ||
|
||
// ïÂÒÁÂÁÔÙ×ÁÅÍ ËÎÏÐËÉ | ||
while (1) | ||
{ | ||
uint16_t c=ps2_read(); | ||
|
||
switch (c) | ||
{ | ||
case PS2_ESC: | ||
case PS2_MENU: | ||
// ÷ÙÈÏÄ | ||
goto done; | ||
|
||
case PS2_UP: | ||
// ÷×ÅÒÈ | ||
if (line > 0) | ||
{ | ||
line--; | ||
goto draw; | ||
} | ||
break; | ||
|
||
case PS2_DOWN: | ||
// ÷ÎÉÚ | ||
if (line+30 < n_lines) | ||
{ | ||
line++; | ||
goto draw; | ||
} | ||
break; | ||
|
||
case PS2_PGUP: | ||
// óÔÒÁÎÉÃÁ ××ÅÒÈ | ||
if (line > 0) | ||
{ | ||
line-=29; | ||
if (line < 0) line=0; | ||
goto draw; | ||
} | ||
break; | ||
|
||
case PS2_PGDN: | ||
// óÔÒÁÎÉÃÁ ×ÎÉÚ | ||
if (line+30 < n_lines) | ||
{ | ||
line+=29; | ||
if (line+30 >= n_lines) | ||
line=n_lines-30; | ||
goto draw; | ||
} | ||
break; | ||
|
||
case PS2_HOME: | ||
// îÁÞÁÌÏ | ||
if (line > 0) | ||
{ | ||
line=0; | ||
goto draw; | ||
} | ||
break; | ||
|
||
case PS2_END: | ||
// ëÏÎÅà | ||
if (line+30 < n_lines) | ||
{ | ||
line=n_lines-30; | ||
goto draw; | ||
} | ||
break; | ||
} | ||
} | ||
|
||
done: | ||
ui_stop(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef HELP_H | ||
#define HELP_H | ||
|
||
|
||
void help_display(void); | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
#include "ets.h" | ||
|
||
|
||
extern char ui_scr[38][78]; | ||
extern char ui_scr[38][80]; | ||
|
||
|
||
void ui_clear(void); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /bin/bash | ||
|
||
./mkhelp || exit | ||
|
||
/home/heavy/KLAD/x-tools/esp8266/xtensa-lx106-elf/bin/esptool.py \ | ||
--port /dev/ttyUSB0 \ | ||
write_flash \ | ||
--flash_size 8m \ | ||
--flash_freq 20m \ | ||
--flash_mode dio \ | ||
0x50000 help.bin \ | ||
|| exit | ||
|
||
/home/heavy/KLAD/x-tools/esp8266/xtensa-lx106-elf/bin/esptool.py run || exit | ||
|
||
telnet localhost 60485 |
Binary file not shown.
Oops, something went wrong.