MCPcopy Create free account
hub / github.com/Marus/cortex-debug / calculatePortMask

Function calculatePortMask

src/common.ts:476–491  ·  view source on GitHub ↗
(decoders: any[])

Source from the content-addressed store, hash-verified

474}
475
476export function calculatePortMask(decoders: any[]) {
477 if (!decoders) { return 0; }
478
479 let mask: number = 0;
480 decoders.forEach((d) => {
481 if (d.type === 'advanced') {
482 for (const port of d.ports) {
483 mask = (mask | (1 << port)) >>> 0;
484 }
485 }
486 else {
487 mask = (mask | (1 << d.port)) >>> 0;
488 }
489 });
490 return mask;
491}
492
493export function createPortName(procNum: number, prefix: string = 'gdbPort'): string {
494 return prefix + ((procNum === 0) ? '' : procNum.toString());

Calls

no outgoing calls

Tested by

no test coverage detected