@mchp-mcc/scf-pic8-pwm-v2 4.2.7 → 4.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mchp-mcc/scf-pic8-pwm-v2",
3
- "version": "4.2.7",
3
+ "version": "4.2.9",
4
4
  "scf": {
5
5
  "reducer": "auto",
6
6
  "creator": "output/creator.js",
@@ -105,8 +105,8 @@
105
105
  "profile": "jest profile",
106
106
  "build-run-dir-future": "node config/extract-run-directory-future.js",
107
107
  "release": "yarn build && yarn test && node -e 'require(\"./config/scf-project-scripts\").releaseProject()'",
108
- "test:itf:all": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --sf=pwmV2.major.test.ts --df=\"PIC16F18076|PIC16F18877|PIC18F47Q10\"",
109
- "test:itf:dev": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --sf=pwmV2.major.test.ts --df=\"PIC16F18076\"",
108
+ "test:itf:all": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --sf=pwmV2.major.test.ts --df=\"PIC16LF1566|PIC16LF1567\"",
109
+ "test:itf:dev": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --sf=pwmV2.major.test.ts --df=\"PIC16LF1566\"",
110
110
  "postprocess": "node config/appendPrototype.js"
111
111
  },
112
112
  "husky": {
@@ -151,9 +151,9 @@
151
151
  "@microchip/basic_pin": "^1.0.2",
152
152
  "@microchip/fosc-hz": "^0.1.2",
153
153
  "@microchip/osc-clocks": "^0.2.0",
154
- "@microchip/pin-standard": "^0.2.14",
155
- "@microchip/scf-common": "^3.17.0",
156
- "@microchip/scf-device": "^8.5.0",
154
+ "@microchip/pin-standard": "^0.6.0",
155
+ "@microchip/scf-common": "^3.21.0",
156
+ "@microchip/scf-device": "^8.9.0",
157
157
  "@microchip/scf-integration-test": "^1.0.0",
158
158
  "@microchip/scf-interface": "^1.4.0",
159
159
  "@microchip/scf-register-view-helper": "^2.5.0",
@@ -169,16 +169,16 @@
169
169
  "@babel/preset-env": "^7.9.6",
170
170
  "@babel/preset-react": "^7.9.4",
171
171
  "@babel/preset-typescript": "^7.9.0",
172
- "@mchp-mcc/pic-8bit": "^5.9.0-dev.5",
173
- "@mchp-mcc/pic-8bit-types": "^5.9.0-dev.5",
174
- "@microchip/ccl-itf": "^1.5.0",
175
- "@microchip/initializer-system": "^0.5.3",
176
- "@microchip/melody-automodule-interface": "^1.5.1",
172
+ "@mchp-mcc/pic-8bit": "^5.19.1-dev.2",
173
+ "@mchp-mcc/pic-8bit-types": "^5.19.1-dev.2",
174
+ "@microchip/ccl-itf": "^1.6.0",
175
+ "@microchip/initializer-system": "^0.5.5",
176
+ "@microchip/melody-automodule-interface": "^1.10.3",
177
177
  "@microchip/pic-8bit-types": "^5.0.1",
178
178
  "@microchip/run-directory": "^4.2.3",
179
- "@microchip/scf-automodule": "^5.5.1",
180
- "@microchip/scf-automodule-impl": "^1.7.1",
181
- "@microchip/scf-autoview": "^3.26.1",
179
+ "@microchip/scf-automodule": "^5.10.4",
180
+ "@microchip/scf-automodule-impl": "^1.12.3",
181
+ "@microchip/scf-autoview": "^3.32.4",
182
182
  "@microchip/scf-project-scripts": "^1.0.0",
183
183
  "@types/core-js": "^2.5.1",
184
184
  "@types/enzyme": "^3.9.3",
@@ -220,7 +220,7 @@
220
220
  "prettier": "^2.0.5",
221
221
  "ts-jest": "^24.0.2",
222
222
  "ts-pnp": "^1.1.2",
223
- "typescript": "^4.0.5",
223
+ "typescript": "~4.5.5",
224
224
  "webpack": "^4.34.0",
225
225
  "webpack-cli": "^3.3.4",
226
226
  "webpack-merge": "^4.2.2",
@@ -44,7 +44,7 @@ describe("Empty Derived Data Test ", () => {
44
44
  describe("C custom name validator", () => {
45
45
  it("invalid Custom name", () => {
46
46
  const mockModule = mockAssignedModule(mockState());
47
- const model = getModel(mockModule, getDerivedData);
47
+ const model = getModel(mockModule, getDerivedData as any);
48
48
  const derivedData = model?.getDerivedData() as DerivedData;
49
49
  const derivedFunctions = derivedData?.getMyFunctions();
50
50
  const cName = new RegExp(derivedFunctions.componentNameValidator().pattern);
@@ -54,7 +54,7 @@ describe("C custom name validator", () => {
54
54
 
55
55
  describe("Import Interface test Cases ", () => {
56
56
  const mockMod = mockAssignedModule(mockState());
57
- const model = getModel(mockMod, MyDerivedData.getDerivedData);
57
+ const model = getModel(mockMod, MyDerivedData.getDerivedData as any);
58
58
  const derivedData = model?.getDerivedData() as DerivedData;
59
59
  const derivedFunctions = derivedData?.getMyFunctions();
60
60
 
@@ -114,7 +114,7 @@ describe("Alert test Cases ", () => {
114
114
  describe("Default: Timer 2 Dependency Selector ", () => {
115
115
  const model = getModel(
116
116
  mockAssignedModule(getMockState(true, "TMR2", "None")),
117
- MyDerivedData.getDerivedData,
117
+ MyDerivedData.getDerivedData as any,
118
118
  );
119
119
  const derivedData = model?.getDerivedData() as DerivedData;
120
120
  const derivedFunctions = derivedData?.getMyFunctions();
@@ -129,7 +129,7 @@ describe("Alert test Cases ", () => {
129
129
  describe("Default: Timer 4 Dependency Selector", () => {
130
130
  const model = getModel(
131
131
  mockAssignedModule(getMockState(true, "TMR4", "None")),
132
- MyDerivedData.getDerivedData,
132
+ MyDerivedData.getDerivedData as any,
133
133
  );
134
134
  const derivedData = model?.getDerivedData() as DerivedData;
135
135
  const derivedFunctions = derivedData?.getMyFunctions();
@@ -144,7 +144,7 @@ describe("Alert test Cases ", () => {
144
144
  describe("Default: Timer 6 Dependency Selector", () => {
145
145
  const model = getModel(
146
146
  mockAssignedModule(getMockState(true, "TMR6", "None")),
147
- MyDerivedData.getDerivedData,
147
+ MyDerivedData.getDerivedData as any,
148
148
  );
149
149
  const derivedData = model?.getDerivedData() as DerivedData;
150
150
  const derivedFunctions = derivedData?.getMyFunctions();
@@ -178,12 +178,12 @@ describe("Alert test Cases ", () => {
178
178
  },
179
179
  },
180
180
  };
181
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
181
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
182
182
  const derivedData = model?.getDerivedData() as DerivedData;
183
183
  const derivedFunctions = derivedData?.getMyFunctions();
184
184
  const alert1 = {
185
185
  type: "hint",
186
- text: "PWM4 uses TMR2.",
186
+ text: "PWM7 uses TMR2.",
187
187
  };
188
188
  const alert2 = {
189
189
  type: "hint",
@@ -226,7 +226,7 @@ describe("DerivedData for APIs: FilterImports -- >", () => {
226
226
  };
227
227
  const model = getModel(
228
228
  mockAssignedModule(mockState),
229
- getDerivedData,
229
+ getDerivedData as any,
230
230
  ) as AppModel;
231
231
 
232
232
  const derivedData = model?.getDerivedData() as DerivedData;
@@ -253,7 +253,7 @@ describe("DerivedData for APIs: FilterImports -- >", () => {
253
253
  describe("DerivedData for APIs: Processed payload -- >", () => {
254
254
  describe("Timer 2 -->", () => {
255
255
  const mockModule = mockAssignedModule(getMockState(true, "TMR2", "TMR2"));
256
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
256
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
257
257
  const derivedData = model?.getDerivedData() as DerivedData;
258
258
  const derivedFunctions = derivedData?.getMyFunctions();
259
259
  it("Test for Selected Tmr", () => {
@@ -265,43 +265,43 @@ describe("DerivedData for APIs: Processed payload -- >", () => {
265
265
  describe("DerivedData for APIs: Timer selection -- >", () => {
266
266
  describe("Timer 2 -->", () => {
267
267
  const mockModule = mockAssignedModule(getMockState(true, "TMR2", "TMR2"));
268
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
268
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
269
269
  const derivedData = model?.getDerivedData() as DerivedData;
270
270
  const derivedFunctions = derivedData?.getMyFunctions();
271
271
  it("Test for Selected Tmr", () => {
272
- expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM4timer2");
272
+ expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM7timer2");
273
273
  });
274
274
  });
275
275
  describe("Timer 4 -->", () => {
276
276
  const mockModule = mockAssignedModule(getMockState(true, "TMR4", "TMR4"));
277
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
277
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
278
278
  const derivedData = model?.getDerivedData() as DerivedData;
279
279
  const derivedFunctions = derivedData?.getMyFunctions();
280
280
  it("Test for Selected Tmr", () => {
281
- expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM4timer4");
281
+ expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM7timer4");
282
282
  });
283
283
  });
284
284
  describe("No-->", () => {
285
285
  const mockModule = mockAssignedModule(getMockState(true, "TMR6", "TMR6"));
286
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
286
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
287
287
  const derivedData = model?.getDerivedData() as DerivedData;
288
288
  const derivedFunctions = derivedData?.getMyFunctions();
289
289
  it("Test for Selected Tmr", () => {
290
- expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM4timer6");
290
+ expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM7timer6");
291
291
  });
292
292
  });
293
293
  describe("No PWM Timer -->", () => {
294
294
  const mockModule = mockAssignedModule(getMockState(true, undefined, "None"));
295
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
295
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
296
296
  const derivedData = model?.getDerivedData() as DerivedData;
297
297
  const derivedFunctions = derivedData?.getMyFunctions();
298
298
  it("Test for Selected Tmr", () => {
299
- expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM4timer2");
299
+ expect(derivedFunctions?.ctselPwmtmrs?.()).toEqual("PWM7timer2");
300
300
  });
301
301
  });
302
302
  describe("Invalid Timer -->", () => {
303
303
  const mockModule = mockAssignedModule(getMockState(true, "TMR", "TMR"));
304
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
304
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
305
305
  const derivedData = model?.getDerivedData() as DerivedData;
306
306
  const derivedFunctions = derivedData?.getMyFunctions();
307
307
  it("Test for Selected Tmr", () => {
@@ -313,14 +313,14 @@ describe("DerivedData for APIs: Timer selection -- >", () => {
313
313
  describe("DerivedData for APIs: sdl help override -- >", () => {
314
314
  describe("DerivedData for APIs -- >", () => {
315
315
  const mockModule = mockAssignedModule(getMockState(true, "TMR2", "TMR2"));
316
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
316
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
317
317
  const derivedData = model?.getDerivedData() as DerivedData;
318
318
  const derivedFunctions = derivedData?.getMyFunctions();
319
319
  it("Test for Pin Data value", () => {
320
320
  expect(derivedFunctions?.pinData()).toEqual({});
321
321
  });
322
322
  it("Test for Module Name value", () => {
323
- expect(derivedFunctions?.moduleName?.()).toEqual("PWM4");
323
+ expect(derivedFunctions?.moduleName?.()).toEqual("PWM7");
324
324
  });
325
325
  // it("Test for Custom Name value", () => {
326
326
  // expect(derivedFunctions?.componentName?.()).toEqual(undefined);
@@ -361,7 +361,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
361
361
  },
362
362
  },
363
363
  };
364
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
364
+ const mockModel = getModel(
365
+ mockAssignedMod,
366
+ MyDerivedData.getDerivedData as any,
367
+ );
365
368
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
366
369
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
367
370
  // expect(mockDerivedFunctions?.overrideOptions?.("ccpTimer")).toEqual([]);
@@ -393,7 +396,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
393
396
  },
394
397
  },
395
398
  };
396
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
399
+ const mockModel = getModel(
400
+ mockAssignedMod,
401
+ MyDerivedData.getDerivedData as any,
402
+ );
397
403
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
398
404
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
399
405
  // expect(mockDerivedFunctions?.overrideOptions?.("ccpTimer")).toEqual([]);
@@ -421,7 +427,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
421
427
  },
422
428
  },
423
429
  };
424
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
430
+ const mockModel = getModel(
431
+ mockAssignedMod,
432
+ MyDerivedData.getDerivedData as any,
433
+ );
425
434
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
426
435
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
427
436
  // expect(mockDerivedFunctions?.overrideOptions?.("ccpTimer")).toEqual([]);
@@ -460,7 +469,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
460
469
  },
461
470
  },
462
471
  };
463
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
472
+ const mockModel = getModel(
473
+ mockAssignedMod,
474
+ MyDerivedData.getDerivedData as any,
475
+ );
464
476
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
465
477
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
466
478
  expect(
@@ -492,7 +504,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
492
504
  },
493
505
  },
494
506
  };
495
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
507
+ const mockModel = getModel(
508
+ mockAssignedMod,
509
+ MyDerivedData.getDerivedData as any,
510
+ );
496
511
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
497
512
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
498
513
  expect(
@@ -524,7 +539,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
524
539
  },
525
540
  },
526
541
  };
527
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
542
+ const mockModel = getModel(
543
+ mockAssignedMod,
544
+ MyDerivedData.getDerivedData as any,
545
+ );
528
546
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
529
547
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
530
548
  expect(
@@ -557,7 +575,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
557
575
  },
558
576
  },
559
577
  };
560
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
578
+ const mockModel = getModel(
579
+ mockAssignedMod,
580
+ MyDerivedData.getDerivedData as any,
581
+ );
561
582
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
562
583
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
563
584
  expect(
@@ -586,7 +607,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
586
607
  },
587
608
  },
588
609
  };
589
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
610
+ const mockModel = getModel(
611
+ mockAssignedMod,
612
+ MyDerivedData.getDerivedData as any,
613
+ );
590
614
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
591
615
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
592
616
  expect(
@@ -605,7 +629,10 @@ describe("DerivedData for APIs: sdl help override -- >", () => {
605
629
  },
606
630
  },
607
631
  };
608
- const mockModel = getModel(mockAssignedMod, MyDerivedData.getDerivedData);
632
+ const mockModel = getModel(
633
+ mockAssignedMod,
634
+ MyDerivedData.getDerivedData as any,
635
+ );
609
636
  const mockDerivedData = mockModel?.getDerivedData() as DerivedData;
610
637
  const mockDerivedFunctions = mockDerivedData?.getMyFunctions();
611
638
  expect(
@@ -14,6 +14,7 @@ import { getAutoSdlHelp } from "@microchip/scf-automodule-impl/lib/autoModule/Co
14
14
  import { getPinsLogic } from "../generated_module/src/pins/PCPHelper";
15
15
  import { MyImports } from "../generated_module/src/types";
16
16
  import { getCFunctionValidator, PatternValidator } from "@microchip/scf-validators/lib";
17
+ import { QueryAdapterKey, intf_args } from "@microchip/pin-standard/lib/pin-standard";
17
18
 
18
19
  export const getDerivedData = (dataModel: AppModel): DerivedData => {
19
20
  if (dataModel) {
@@ -88,6 +89,7 @@ class MyDerivedData implements DerivedData {
88
89
  importName: this.friendlyImportName,
89
90
  componentNameValidator: this.componentNameValidator,
90
91
  getCustomUiErrors: this.getCustomUiErrors,
92
+ pin_standard_args: this.getPinstandardArgs,
91
93
  };
92
94
  };
93
95
 
@@ -128,6 +130,17 @@ class MyDerivedData implements DerivedData {
128
130
  }
129
131
  };
130
132
 
133
+ private readonly getPinstandardArgs = (): intf_args => {
134
+ const args: intf_args = {
135
+ queryAdapters: ["pps", "apfcon"],
136
+ queryAdapterMap: {
137
+ [QueryAdapterKey.ALLPINS]: "^PWM[0-9]{0,1}$",
138
+ },
139
+ };
140
+
141
+ return args;
142
+ };
143
+
131
144
  private overrideDefaultOptions = (componentName: string): any[] => {
132
145
  switch (componentName) {
133
146
  case "timerSelection": {
@@ -140,7 +153,7 @@ class MyDerivedData implements DerivedData {
140
153
  if (CCPTMRSREG) {
141
154
  const CTSELSETT = CCPTMRSREG.settings?.CTSEL;
142
155
  for (const eachoptn of CTSELSETT?.options ?? []) {
143
- const timeroptnregex = /^pwm[0-9]timer([0-9])$/i;
156
+ const timeroptnregex = /^pwm\d+timer(\d)$/i;
144
157
  const optnmatch = eachoptn.alias.match(timeroptnregex);
145
158
  const correctOptnName =
146
159
  (optnmatch?.length ?? 0) > 1 ? "TMR" + optnmatch?.[1] : "";
@@ -150,7 +163,7 @@ class MyDerivedData implements DerivedData {
150
163
  if (PWMTMRSREG) {
151
164
  const CTSELSETT = PWMTMRSREG.settings?.CTSEL;
152
165
  for (const eachoptn of CTSELSETT?.options ?? []) {
153
- const timeroptnregex = /^pwm[0-9]timer([0-9])$/i;
166
+ const timeroptnregex = /^pwm\d+timer(\d)$/i;
154
167
  const optnmatch = eachoptn.alias.match(timeroptnregex);
155
168
  const correctOptnName =
156
169
  (optnmatch?.length ?? 0) > 1 ? "TMR" + optnmatch?.[1] : "";
@@ -258,7 +271,7 @@ class MyDerivedData implements DerivedData {
258
271
  );
259
272
  }
260
273
 
261
- return getAutoSdlHelp(this.getModel(), componentName, helpUrl);
274
+ return getAutoSdlHelp(this.getModel() as any, componentName, helpUrl);
262
275
  };
263
276
 
264
277
  private pwm_general_parameters_payload = (): pwm_general.ProcessedPayload => {
@@ -9,7 +9,7 @@ describe("GeneratorModel", () => {
9
9
  describe("getGeneratorModel", () => {
10
10
  test("componentName is undefined", () => {
11
11
  const mockModule = mockAssignedModule(mockState());
12
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
12
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
13
13
  if (model) {
14
14
  model.getComponentValue = (comp_name: string): any => {
15
15
  const compData = {
@@ -25,7 +25,7 @@ describe("GeneratorModel", () => {
25
25
 
26
26
  test("PeripheralDescription is undefined", () => {
27
27
  const mockModule = mockAssignedModule(mockState());
28
- const model = getModel(mockModule, MyDerivedData.getDerivedData);
28
+ const model = getModel(mockModule, MyDerivedData.getDerivedData as any);
29
29
  if (model) {
30
30
  model.getPeripheralDescription = (): any => {
31
31
  return undefined;
@@ -36,34 +36,4 @@ describe("GeneratorModel", () => {
36
36
  }
37
37
  });
38
38
  });
39
- // describe("convertToTemplate", () => {
40
- // test("Hardware is undefined", () => {
41
- // const mockModule = mockAssignedModule(mockState());
42
- // const model = getModel(mockModule, MyDerivedData.getDerivedData);
43
-
44
- // if (model) {
45
- // model.getHardware = (): any => {
46
- // return undefined;
47
- // };
48
- // const result1 = GenertorModel.convertToTemplate(
49
- // model as AppModel,
50
- // "positive",
51
- // [],
52
- // );
53
- // expect(result1.length).toBe(0);
54
- // const result2 = GenertorModel.convertToTemplate(
55
- // model as AppModel,
56
- // "negative",
57
- // [],
58
- // );
59
- // expect(result2.length).toBe(0);
60
- // const result3 = GenertorModel.convertToTemplate(
61
- // model as AppModel,
62
- // "none",
63
- // [],
64
- // );
65
- // expect(result3.length).toBe(0);
66
- // }
67
- // });
68
- // });
69
39
  });