@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.
- package/Changelog.md +6 -0
- package/Readme.md +6 -0
- package/output/autoCreator.js +106 -2
- package/output/autoCreator.js.map +1 -1
- package/output/autoProcessor.js +106 -2
- package/output/autoProcessor.js.map +1 -1
- package/output/creator.js +106 -2
- package/output/creator.js.map +1 -1
- package/output/processor.js +106 -2
- package/output/processor.js.map +1 -1
- package/output/pwm-v2.c.ftl +1 -1
- package/output/pwm-v2.h.ftl +7 -7
- package/package.json +4 -4
- package/src/DerivedData.test.ts +11 -0
- package/src/DerivedData.ts +24 -0
- package/src/moduleConfig.json +2 -1
package/output/pwm-v2.c.ftl
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @ingroup ${moduleNameLowerCase}
|
|
7
7
|
*
|
|
8
|
-
* @brief This file contains the
|
|
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
|
*/
|
package/output/pwm-v2.h.ftl
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @defgroup ${moduleNameLowerCase} ${moduleNameUpperCase}
|
|
7
7
|
*
|
|
8
|
-
* @brief This
|
|
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
|
|
35
|
-
* @param
|
|
36
|
-
* @return
|
|
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
|
|
43
|
-
* @param ${api.LoadDutyValue.arguments[0].type} ${api.LoadDutyValue.arguments[0].name} -
|
|
44
|
-
* @return
|
|
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.
|
|
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/@
|
|
109
|
-
"test:itf:dev": "node ./node_modules/@
|
|
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",
|
package/src/DerivedData.test.ts
CHANGED
|
@@ -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);
|
package/src/DerivedData.ts
CHANGED
|
@@ -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": {
|