@mchp-mcc/timer
Advanced tools
Comparing version 1.2.0 to 1.2.1
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
## [1.2.1] - 2024-03-29 | ||
### Bug Fixes | ||
- **CC16SCRIP-7916** :- Setting the timer period to its maximum value results in a calculation of Period register to zero | ||
## [1.2.0] - 2023-12-20 | ||
@@ -5,0 +11,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hooks = void 0; | ||
var processor_1 = require("./processor"); | ||
var creator_1 = require("./creator"); | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
var packageJson = require("../../../package.json"); | ||
const processor_1 = require("./processor"); | ||
const creator_1 = require("./creator"); | ||
exports.hooks = { | ||
@@ -12,6 +10,3 @@ process: processor_1.process, | ||
reducer: "auto", | ||
displayName: packageJson.scf.displayName, | ||
category: packageJson.scf.category, | ||
views: packageJson.scf.views, | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@mchp-mcc/timer", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"scf": { | ||
@@ -13,3 +13,5 @@ "reducer": "auto", | ||
"category": "Drivers/Timer", | ||
"nullPrototype": "output/nullPrototype.json" | ||
"nullPrototype": "output/nullPrototype.json", | ||
"autoProcessor": "output/autoProcessor.js", | ||
"autoCreator": "output/autoCreator.js" | ||
}, | ||
@@ -19,4 +21,4 @@ "scf-automodule": { | ||
"hookPaths": { | ||
"processor": "generated_module/src/processor.tsx", | ||
"creator": "generated_module/src/creator.tsx" | ||
"processor": "generated_module/src/processor.ts", | ||
"creator": "generated_module/src/creator.ts" | ||
}, | ||
@@ -45,3 +47,4 @@ "shouldNotifyOnDeploy": false | ||
"test-itf-all": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --df=\"dsPIC33CK64MC105|dsPIC33CK256MC506|dsPIC33CDV64MC106|dsPIC33CK64MP105|dsPIC33CDVL64MC106|dsPIC33CDV256MP506|dsPIC33CK512MPT608|dsPIC33CDVC256MP506|dsPIC33CK256MP508|dsPIC33CK512MP608|dsPIC33CK1024MP710|dsPIC33CH512MP508|dsPIC33CH128MP508\"", | ||
"test-itf": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --df=\"dsPIC33CH128MP508$\"" | ||
"test-itf": "node ./node_modules/@microchip/ccl-itf/lib/index.js --sp=./tests/itf --rd=./run --df=\"dsPIC33CH128MP508$\"", | ||
"postprocess": "node config/appendPrototype.js" | ||
}, | ||
@@ -75,9 +78,9 @@ "files": [ | ||
"@microchip/pic-8bit-types": "^5.0.1", | ||
"@microchip/pin-standard": "^0.2.14", | ||
"@microchip/scf-automodule-interface": "^0.17.0", | ||
"@microchip/scf-common": "^3.13.4", | ||
"@microchip/scf-device": "^8.2.0", | ||
"@microchip/pin-standard": "^0.6.0", | ||
"@microchip/pins-interface": "^1.0.1", | ||
"@microchip/scf-common": "^3.22.3", | ||
"@microchip/scf-device": "^8.11.1", | ||
"@microchip/scf-integration-test": "^1.0.0", | ||
"@microchip/scf-interface": "^1.4.0", | ||
"@microchip/scf-register-view-helper": "^2.4.0", | ||
"@microchip/scf-register-view-helper": "^2.7.0", | ||
"@microchip/timer-driver-interface": "^0.1.0", | ||
@@ -97,7 +100,7 @@ "@microchip/timer-periodic": "^2.0.0", | ||
"@microchip/initializer-system": "^0.5.3", | ||
"@microchip/melody-automodule-interface": "^1.10.3", | ||
"@microchip/run-directory": "^4.2.4", | ||
"@microchip/run-directory-future": "^1.0.5", | ||
"@microchip/scf-automodule": "^4.14.6", | ||
"@microchip/scf-autoview": "^3.17.0", | ||
"@microchip/melody-automodule-interface": "^1.14.1", | ||
"@microchip/run-directory": "^4.3.2", | ||
"@microchip/scf-automodule": "^5.13.1", | ||
"@microchip/scf-automodule-impl": "^1.14.1", | ||
"@microchip/scf-autoview": "^3.32.5", | ||
"@microchip/scf-project-scripts": "^1.0.0", | ||
@@ -144,3 +147,3 @@ "@types/core-js": "^2.5.1", | ||
"ts-pnp": "^1.1.2", | ||
"typescript": "^4.0.5", | ||
"typescript": "~4.5.5", | ||
"webpack": "^4.34.0", | ||
@@ -147,0 +150,0 @@ "webpack-cli": "^3.3.4", |
@@ -18,2 +18,8 @@ # MCC Melody Timer Driver | ||
## [1.2.1] - 2024-03-29 | ||
### Bug Fixes | ||
- **CC16SCRIP-7916** :- Setting the timer period to its maximum value results in a calculation of Period register to zero | ||
## [1.2.0] - 2023-12-20 | ||
@@ -20,0 +26,0 @@ |
@@ -12,2 +12,5 @@ import { | ||
import { ExportArg } from "@microchip/melody-automodule-interface/lib/src/InterfaceTypes"; | ||
import { SoftwareTimeComponent } from "@microchip/melody-automodule-interface/lib/src/SoftwareComponents"; | ||
import { requestedTimerValidatorHelper, convertTimeInMs } from "./Utils"; | ||
import { ModuleConfig } from "@microchip/melody-automodule-interface"; | ||
@@ -17,3 +20,4 @@ const TIMER_PERIODIC_INTERFACE_NAME = "timer_periodic"; | ||
const CUSTOM_NAME_COMPONENT = "customName"; | ||
const REQUESTED_TIMER_PERIOD_COMPONENT = "requestedTimer_ms"; | ||
const REQUESTED_TIMER_PERIOD_COMPONENT = "requestedTimerPeriod"; | ||
const ACTUAL_TIMER_PERIOD_COMPONENT = "actualTimerPeriod_ms"; | ||
const REQUESTED_TIMER_PERIOD_ARGUMENT = "requestedTimerPeriod_ms"; | ||
@@ -61,3 +65,3 @@ const TIMER_ENABLE = "enableModule"; | ||
overrideDefaultValues: this.overrideDefaultValue, | ||
requestedTimer_msValidator: this.requestedTimerValidator, | ||
requestedTimerPeriod: this.requestedTimerValidator, | ||
importName: this.getFriendlyImportName, | ||
@@ -71,5 +75,59 @@ timer_periodic_results: this.getTimerPeriodicResults, | ||
"timer-driver-interface_payload": this.getTimerDriverPayload, | ||
getDynamicComponents: this.getDynamicComponents, | ||
}; | ||
}; | ||
private getDynamicComponents = (): ModuleConfig.SoftwareComponent[] => { | ||
const data: ModuleConfig.SoftwareComponent[] = []; | ||
const reqTmrStateVal = this.dataModel.getState()?.main?.software?.[ | ||
"requestedTimer_ms" | ||
]; | ||
const requestedTimerPeriod: ModuleConfig.SoftwareComponent = { | ||
name: REQUESTED_TIMER_PERIOD_COMPONENT, | ||
description: "Requested Timer Period", | ||
type: "time", | ||
defaultValue: { | ||
value: | ||
reqTmrStateVal ?? | ||
this.getArgsFromTimerDrvIntf(REQUESTED_TIMER_PERIOD_ARGUMENT) ?? | ||
1, | ||
unit: "ms", | ||
}, | ||
group: "software", | ||
tabs: ["main"], | ||
category: "software", | ||
validation: true, | ||
}; | ||
data.push(requestedTimerPeriod); | ||
const actualTimerPeriod_ms: ModuleConfig.SoftwareComponent = { | ||
name: ACTUAL_TIMER_PERIOD_COMPONENT, | ||
description: "Calculated Timer Period", | ||
type: "time", | ||
defaultValue: { | ||
value: | ||
requestedTimerValidatorHelper( | ||
this.dataModel.getImportValue(TIMER_PERIODIC_INTERFACE_NAME) | ||
?.actualTimerPeriod_ms, | ||
)?.value ?? 0, | ||
unit: | ||
requestedTimerValidatorHelper( | ||
this.dataModel.getImportValue(TIMER_PERIODIC_INTERFACE_NAME) | ||
?.actualTimerPeriod_ms, | ||
)?.unit ?? "ms", | ||
}, | ||
group: "software", | ||
tabs: ["main"], | ||
category: "software", | ||
validation: true, | ||
uiBehavior: { | ||
readonly: true, | ||
}, | ||
}; | ||
data.push(actualTimerPeriod_ms); | ||
return data; | ||
}; | ||
public getTimerDriverPayload = (): | ||
@@ -146,11 +204,2 @@ | timer_driver_interface.ProcessedPayload | ||
case REQUESTED_TIMER_PERIOD_COMPONENT: { | ||
return ( | ||
this.getArgsFromDrvIntf( | ||
REQUESTED_TIMER_PERIOD_ARGUMENT, | ||
TIMER_DRIVER_INTERFACE_NAME, | ||
)?.value ?? 1 | ||
); | ||
} | ||
case TIMER_ENABLE: | ||
@@ -169,2 +218,3 @@ return ( | ||
); | ||
default: | ||
@@ -300,2 +350,27 @@ break; | ||
private getArgsFromTimerDrvIntf = ( | ||
componentName: string, | ||
): timer_driver_interface.Arguments | undefined => { | ||
const timerArgsMap = this.dataModel | ||
?.getExportInterfaces() | ||
?.getInterface( | ||
"timer_driver_interface", | ||
timer_driver_interface.Interface.getInterfaceId(), | ||
)?.args; | ||
if (timerArgsMap) { | ||
for (const timerArgs in timerArgsMap) { | ||
const argsList = timerArgsMap[timerArgs]; | ||
for (const arg in argsList) { | ||
if (arg === componentName) { | ||
return argsList[arg]; | ||
} | ||
} | ||
} | ||
} | ||
return undefined; | ||
}; | ||
public getUIBehaviorStrField = ( | ||
@@ -327,4 +402,4 @@ component: string, | ||
interruptDriven: this.dataModel.getComponentValue("interruptDriven"), | ||
requestedTimerPeriod_ms: this.dataModel.getComponentValue( | ||
REQUESTED_TIMER_PERIOD_COMPONENT, | ||
requestedTimerPeriod_ms: convertTimeInMs( | ||
this.dataModel.getComponentValue(REQUESTED_TIMER_PERIOD_COMPONENT), | ||
), | ||
@@ -342,15 +417,26 @@ interruptCallback: this.getArgsFromDrvIntf( | ||
private requestedTimerValidator = (): any => { | ||
private requestedTimerValidator = (): Partial<SoftwareTimeComponent> => { | ||
return { | ||
minimum: Number(this.getMinTimerPeriod().toFixed(4)), | ||
maximum: Number(this.getMaxTimerPeriod().toFixed(4)), | ||
pattern: "[0-9]*[.]?[0-9]+", | ||
timeMeta: { | ||
min: requestedTimerValidatorHelper(this.getMinTimerPeriod()), | ||
max: requestedTimerValidatorHelper(this.getMaxTimerPeriod()), | ||
}, | ||
}; | ||
}; | ||
public getActualTimerPeriodData = (): number => { | ||
return ( | ||
this.dataModel.getImportValue(TIMER_PERIODIC_INTERFACE_NAME) | ||
?.actualTimerPeriod_ms ?? 0 | ||
); | ||
public getActualTimerPeriodData = (): Partial<SoftwareTimeComponent> => { | ||
return { | ||
defaultValue: { | ||
value: | ||
requestedTimerValidatorHelper( | ||
this.dataModel.getImportValue(TIMER_PERIODIC_INTERFACE_NAME) | ||
?.actualTimerPeriod_ms, | ||
)?.value ?? 0, | ||
unit: | ||
requestedTimerValidatorHelper( | ||
this.dataModel.getImportValue(TIMER_PERIODIC_INTERFACE_NAME) | ||
?.actualTimerPeriod_ms, | ||
)?.unit ?? "ms", | ||
}, | ||
}; | ||
}; | ||
@@ -357,0 +443,0 @@ |
@@ -85,28 +85,2 @@ { | ||
}, | ||
"requestedTimer_ms": { | ||
"name": "requestedTimer_ms", | ||
"description": "Requested Timer Period (ms)", | ||
"type": "number", | ||
"defaultValue": 1, | ||
"validation": true, | ||
"group": "software", | ||
"tabs": [ | ||
"main" | ||
], | ||
"category": "software" | ||
}, | ||
"actualTimerPeriod_ms": { | ||
"name": "actualTimerPeriod_ms", | ||
"description": "Calculated Timer Period (ms)", | ||
"type": "number", | ||
"defaultValue": 1, | ||
"group": "software", | ||
"tabs": [ | ||
"main" | ||
], | ||
"uiBehavior": { | ||
"readonly": true | ||
}, | ||
"category": "software" | ||
}, | ||
"hasInterrupt": { | ||
@@ -113,0 +87,0 @@ "name": "hasInterrupt", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1738560
19
16730
47
0