Skip to content

Commit 27ae753

Browse files
author
pablomarx
committed
Merge pull request #2 from pablomarx/squeak377
Squeak VM 3.7-7
2 parents 2439183 + 66347f4 commit 27ae753

18 files changed

+15717
-14171
lines changed

bcm2835/sqRpiHid.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ int keyBufPut = 0; /* index of next item of keyBuf to write
1414
int keyBufOverflows = 0; /* number of characters dropped */
1515

1616
/*** Variables -- Imported from Virtual Machine ***/
17-
extern int interruptCheckCounter;
18-
extern int interruptKeycode;
19-
extern int interruptPending; /* set to true by RecordKeystroke if interrupt key is pressed */
17+
int interruptCheckCounter = 0;
18+
int interruptKeycode = -1;
19+
int interruptPending = 0; /* set to true by RecordKeystroke if interrupt key is pressed */
2020

2121
/*** Variables -- Event Recording ***/
2222
#define MillisecondClockMask 536870911
@@ -29,6 +29,7 @@ static char lastKeys[255];
2929
static int lastMouseX = 0;
3030
static int lastMouseY = 0;
3131
static int lastMouseButton = 0;
32+
static int lastPollTime = 0;
3233

3334
void RecordKeystroke(unsigned char key, struct KeyboardModifiers modifiers) {
3435
int keystate;
@@ -157,7 +158,7 @@ void rpiRegisterKeyboardEvent(int keyCode, int pressCode, int modifiers) {
157158
evt->pressCode = pressCode;
158159
evt->modifiers = modifiers;
159160

160-
evt->reserved1=evt->reserved2=evt->reserved3= 0;
161+
evt->reserved1=evt->reserved2= 0;
161162
}
162163

163164
void rpiProcessKeyboardEvents(void) {
@@ -216,6 +217,11 @@ void rpiProcessKeyboardEvents(void) {
216217
}
217218

218219
int ioGetNextEvent(sqInputEvent *evt) {
220+
if (ioMSecs() - lastPollTime < 75) {
221+
return false;
222+
}
223+
lastPollTime = ioMSecs();
224+
219225
ioProcessEvents();
220226
rpiProcessMouseEvents();
221227
rpiProcessKeyboardEvents();

lib/memutils.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ extern void abort(void);
99
void * malloc ( unsigned int size )
1010
{
1111
void *ret;
12-
printf("malloc(%i now:", size);
12+
// printf("malloc(%i now:", size);
1313
size = ROUND_UP(size, 8);
14-
printf("%i) => ", size);
14+
// printf("%i) => ", size);
1515

1616
ret=(void *)malloc_base;
1717

18-
printf("0x%08x\n", ret);
18+
// printf("0x%08x\n", ret);
1919

2020
malloc_base+=size;
2121

@@ -30,14 +30,14 @@ void *calloc(unsigned int nmemb, unsigned int size) {
3030

3131
void *memalign(unsigned int alignment, unsigned int n) {
3232
void *ret;
33-
printf("malloc(%i) => (malloc_base was: 0x%08x, ", n, malloc_base);
33+
// printf("malloc(%i) => (malloc_base was: 0x%08x, ", n, malloc_base);
3434

3535
ret = (void *)ROUND_UP(malloc_base, alignment);
3636

3737
malloc_base += n;
3838
malloc_base = ROUND_UP(malloc_base, alignment);
3939

40-
printf("malloc_base now: 0x%08x) ret => 0x%08x\n", malloc_base, ret);
40+
// printf("malloc_base now: 0x%08x) ret => 0x%08x\n", malloc_base, ret);
4141
return ret;
4242
}
4343

0 commit comments

Comments
 (0)