@mchp-mcc/scf-pic8-pwm-v2 4.2.5 → 4.2.6

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.
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @ingroup ${moduleNameLowerCase}
7
7
  *
8
- * @brief This file contains the driver code for ${moduleNameUpperCase} module.
8
+ * @brief This file contains the API implementations for the ${moduleNameUpperCase} module.
9
9
  *
10
10
  * @version ${moduleNameUpperCase} Driver Version 2.0.2
11
11
  */
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @defgroup ${moduleNameLowerCase} ${moduleNameUpperCase}
7
7
  *
8
- * @brief This header file provides APIs for the ${moduleNameUpperCase} driver.
8
+ * @brief This file contains the API prototypes for the ${moduleNameUpperCase} driver.
9
9
  *
10
10
  * @version ${moduleNameUpperCase} Driver Version 2.0.2
11
11
  */
@@ -31,17 +31,17 @@ ${disclaimer}
31
31
 
32
32
  /**
33
33
  * @ingroup ${moduleNameLowerCase}
34
- * @brief This routine initializes the ${moduleNameUpperCase} interface.
35
- * @param none
36
- * @return none
34
+ * @brief Initializes the ${moduleNameUpperCase} interface.
35
+ * @param None.
36
+ * @return None.
37
37
  */
38
38
  ${simpleApi.Initialize};
39
39
 
40
40
  /**
41
41
  * @ingroup ${moduleNameLowerCase}
42
- * @brief This routine loads the 16 bit duty cycle value.
43
- * @param ${api.LoadDutyValue.arguments[0].type} ${api.LoadDutyValue.arguments[0].name} - load ${moduleNameUpperCase} duty cycle value.
44
- * @return none
42
+ * @brief Loads the 16-bit duty cycle value.
43
+ * @param ${api.LoadDutyValue.arguments[0].type} ${api.LoadDutyValue.arguments[0].name} - ${moduleNameUpperCase} duty cycle value to be loaded.
44
+ * @return None.
45
45
  */
46
46
  ${simpleApi.LoadDutyValue};
47
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mchp-mcc/scf-pic8-pwm-v2",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
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/@mchp-mcc/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run",
109
- "test:itf:dev": "node ./node_modules/@mchp-mcc/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=\"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\"",
110
110
  "postprocess": "node config/appendPrototype.js"
111
111
  },
112
112
  "husky": {
@@ -169,9 +169,9 @@
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/ccl-itf": "^0.2.16",
173
172
  "@mchp-mcc/pic-8bit": "^5.9.0-dev.5",
174
173
  "@mchp-mcc/pic-8bit-types": "^5.9.0-dev.5",
174
+ "@microchip/ccl-itf": "^1.5.0",
175
175
  "@microchip/initializer-system": "^0.5.3",
176
176
  "@microchip/melody-automodule-interface": "^1.5.1",
177
177
  "@microchip/pic-8bit-types": "^5.0.1",
@@ -41,6 +41,17 @@ describe("Empty Derived Data Test ", () => {
41
41
  });
42
42
  });
43
43
 
44
+ describe("C custom name validator", () => {
45
+ it("invalid Custom name", () => {
46
+ const mockModule = mockAssignedModule(mockState());
47
+ const model = getModel(mockModule, getDerivedData);
48
+ const derivedData = model?.getDerivedData() as DerivedData;
49
+ const derivedFunctions = derivedData?.getMyFunctions();
50
+ const cName = new RegExp(derivedFunctions.componentNameValidator().pattern);
51
+ expect(cName.test("custom-Name")).toBe(false);
52
+ });
53
+ });
54
+
44
55
  describe("Import Interface test Cases ", () => {
45
56
  const mockMod = mockAssignedModule(mockState());
46
57
  const model = getModel(mockMod, MyDerivedData.getDerivedData);
@@ -13,6 +13,7 @@ import { MyComponentNames, MyExportNames } from "../generated_module/src/types";
13
13
  import { getAutoSdlHelp } from "@microchip/scf-automodule-impl/lib/autoModule/ContextualHelp";
14
14
  import { getPinsLogic } from "../generated_module/src/pins/PCPHelper";
15
15
  import { MyImports } from "../generated_module/src/types";
16
+ import { getCFunctionValidator, PatternValidator } from "@microchip/scf-validators/lib";
16
17
 
17
18
  export const getDerivedData = (dataModel: AppModel): DerivedData => {
18
19
  if (dataModel) {
@@ -35,6 +36,7 @@ class EmptyDerivedData implements DerivedData {
35
36
  class MyDerivedData implements DerivedData {
36
37
  private dataModel: AppModel;
37
38
  private pwmCalculator: PwmCalculator;
39
+ private cValidator: PatternValidator = getCFunctionValidator();
38
40
 
39
41
  constructor(dataModel: AppModel) {
40
42
  this.dataModel = dataModel;
@@ -83,6 +85,8 @@ class MyDerivedData implements DerivedData {
83
85
  filterImports: this.filterImports,
84
86
  getPinsLogic: getPinsLogic,
85
87
  importName: this.friendlyImportName,
88
+ componentNameValidator: this.componentNameValidator,
89
+ getCustomUiErrors: this.getCustomUiErrors,
86
90
  };
87
91
  };
88
92
 
@@ -103,6 +107,26 @@ class MyDerivedData implements DerivedData {
103
107
  }
104
108
  };
105
109
 
110
+ private componentNameValidator = (): any => {
111
+ return {
112
+ pattern: this.cValidator.getRjsfValidation().pattern,
113
+ };
114
+ };
115
+
116
+ private getCustomUiErrors = (componentName: string): Error[] | undefined => {
117
+ switch (componentName) {
118
+ case "componentName":
119
+ return [
120
+ {
121
+ name: "pattern",
122
+ message: this.cValidator.getCustomErrorMessage(),
123
+ },
124
+ ];
125
+ default:
126
+ return undefined;
127
+ }
128
+ };
129
+
106
130
  private overrideDefaultOptions = (componentName: string): any[] => {
107
131
  switch (componentName) {
108
132
  case "timerSelection": {
@@ -136,7 +136,8 @@
136
136
  "tabs": [
137
137
  "main"
138
138
  ],
139
- "category": "software"
139
+ "category": "software",
140
+ "validation": true
140
141
  },
141
142
  "tmr2Dependency": {
142
143
  "name": "tmr2Dependency",