📄 periph.lst
字号:
221 5 else
222 5 bc = 64;
223 5 for(i=0; i<bc; i++)
224 5 *(EP0BUF+i) = *(point+i);
225 5 //set length and arm Endpoint
226 5 EP0BCH = 0;
227 5 EP0BCL = bc;
228 5 length -= bc;
229 5 point += bc;
230 5 while(EP0CS & bmEPBUSY);
231 5 }
232 4 EP0BCH = 0;
233 4 EP0BCL = 0;
234 4 if(flag == 0)
235 4 {
236 5 ReceiveCount0 = 0;
237 5 ES0 = 1;
238 5 }
239 4 else
240 4 {
241 5 ReceiveCount1 = 0;
C51 COMPILER V7.02b PERIPH 06/30/2004 15:13:17 PAGE 5
242 5 ES1 = 1;
243 5 }
244 4 }
245 3 // Is this a download command ?
246 3 else if(SETUPDAT[0] == VR_DOWNLOAD)
247 3 {
248 4 while(len) // Move new data through EP0OUT
249 4 { // one packet at a time.
250 5 // Arm endpoint - do it here to clear (after sud avail)
251 5 EP0BCH = 0;
252 5 EP0BCL = 0; // Clear bytecount to allow new data in; also stops NAKing
253 5 while(EP0CS & bmEPBUSY);
254 5 bc = EP0BCL; // Get the new bytecount
255 5 Serial_SendString((WORD)EP0BUF,bc,flag);
256 5 len -= bc;
257 5 }
258 4 }
259 3 break;
260 3 }
261 2 default:return(TRUE);
262 2 }
263 1 return(FALSE);
264 1 }
265
266 //-----------------------------------------------------------------------------
267 // USB Interrupt Handlers
268 // The following functions are called by the USB interrupt jump table.
269 //-----------------------------------------------------------------------------
270
271 // Setup Data Available Interrupt Handler
272 void ISR_Sudav(void) interrupt 0
273 {
274 1 GotSUD = TRUE; // Set flag
275 1 EZUSB_IRQ_CLEAR();
276 1 USBIRQ = bmSUDAV; // Clear SUDAV IRQ
277 1 }
278
279 // Setup Token Interrupt Handler
280 void ISR_Sutok(void) interrupt 0
281 {
282 1 EZUSB_IRQ_CLEAR();
283 1 USBIRQ = bmSUTOK; // Clear SUTOK IRQ
284 1 }
285
286 void ISR_Sof(void) interrupt 0
287 {
288 1 EZUSB_IRQ_CLEAR();
289 1 USBIRQ = bmSOF; // Clear SOF IRQ
290 1 }
291
292 void ISR_Ures(void) interrupt 0
293 {
294 1 // whenever we get a USB reset, we should revert to full speed mode
295 1 pConfigDscr = pFullSpeedConfigDscr;
296 1 ((CONFIGDSCR xdata *) pConfigDscr)->type = CONFIG_DSCR;
297 1 pOtherConfigDscr = pHighSpeedConfigDscr;
298 1 ((CONFIGDSCR xdata *) pOtherConfigDscr)->type = OTHERSPEED_DSCR;
299 1
300 1 EZUSB_IRQ_CLEAR();
301 1 USBIRQ = bmURES; // Clear URES IRQ
302 1 }
303
C51 COMPILER V7.02b PERIPH 06/30/2004 15:13:17 PAGE 6
304 void ISR_Susp(void) interrupt 0
305 {
306 1 Sleep = TRUE;
307 1 EZUSB_IRQ_CLEAR();
308 1 USBIRQ = bmSUSP;
309 1 }
310
311 void ISR_Highspeed(void) interrupt 0
312 {
313 1 if (EZUSB_HIGHSPEED())
314 1 {
315 2 pConfigDscr = pHighSpeedConfigDscr;
316 2 ((CONFIGDSCR xdata *) pConfigDscr)->type = CONFIG_DSCR;
317 2 pOtherConfigDscr = pFullSpeedConfigDscr;
318 2 ((CONFIGDSCR xdata *) pOtherConfigDscr)->type = OTHERSPEED_DSCR;
319 2 }
320 1
321 1 EZUSB_IRQ_CLEAR();
322 1 USBIRQ = bmHSGRANT;
323 1 }
324 void ISR_Ep0ack(void) interrupt 0
325 {
326 1 }
327 void ISR_Stub(void) interrupt 0
328 {
329 1 }
330 void ISR_Ep0in(void) interrupt 0
331 {
332 1 }
333 void ISR_Ep0out(void) interrupt 0
334 {
335 1 }
336 void ISR_Ep1in(void) interrupt 0
337 {
338 1 }
339 void ISR_Ep1out(void) interrupt 0
340 {
341 1 }
342 void ISR_Ep2inout(void) interrupt 0
343 {
344 1 }
345 void ISR_Ep4inout(void) interrupt 0
346 {
347 1 }
348 void ISR_Ep6inout(void) interrupt 0
349 {
350 1 }
351 void ISR_Ep8inout(void) interrupt 0
352 {
353 1 }
354 void ISR_Ibn(void) interrupt 0
355 {
356 1 }
357 void ISR_Ep0pingnak(void) interrupt 0
358 {
359 1 }
360 void ISR_Ep1pingnak(void) interrupt 0
361 {
362 1 }
363 void ISR_Ep2pingnak(void) interrupt 0
364 {
365 1 }
C51 COMPILER V7.02b PERIPH 06/30/2004 15:13:17 PAGE 7
366 void ISR_Ep4pingnak(void) interrupt 0
367 {
368 1 }
369 void ISR_Ep6pingnak(void) interrupt 0
370 {
371 1 }
372 void ISR_Ep8pingnak(void) interrupt 0
373 {
374 1 }
375 void ISR_Errorlimit(void) interrupt 0
376 {
377 1 }
378 void ISR_Ep2piderror(void) interrupt 0
379 {
380 1 }
381 void ISR_Ep4piderror(void) interrupt 0
382 {
383 1 }
384 void ISR_Ep6piderror(void) interrupt 0
385 {
386 1 }
387 void ISR_Ep8piderror(void) interrupt 0
388 {
389 1 }
390 void ISR_Ep2pflag(void) interrupt 0
391 {
392 1 }
393 void ISR_Ep4pflag(void) interrupt 0
394 {
395 1 }
396 void ISR_Ep6pflag(void) interrupt 0
397 {
398 1 }
399 void ISR_Ep8pflag(void) interrupt 0
400 {
401 1 }
402 void ISR_Ep2eflag(void) interrupt 0
403 {
404 1 }
405 void ISR_Ep4eflag(void) interrupt 0
406 {
407 1 }
408 void ISR_Ep6eflag(void) interrupt 0
409 {
410 1 }
411 void ISR_Ep8eflag(void) interrupt 0
412 {
413 1 }
414 void ISR_Ep2fflag(void) interrupt 0
415 {
416 1 }
417 void ISR_Ep4fflag(void) interrupt 0
418 {
419 1 }
420 void ISR_Ep6fflag(void) interrupt 0
421 {
422 1 }
423 void ISR_Ep8fflag(void) interrupt 0
424 {
425 1 }
426 void ISR_GpifComplete(void) interrupt 0
427 {
C51 COMPILER V7.02b PERIPH 06/30/2004 15:13:17 PAGE 8
428 1 }
429 void ISR_GpifWaveform(void) interrupt 0
430 {
431 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1077 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 2 13
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -