diff --git a/Example/1-ADC_Demo/Libraries/doc/version.txt b/Example/1-ADC_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/1-ADC_Demo/Libraries/doc/version.txt
+++ b/Example/1-ADC_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/1-ADC_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt b/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt
+++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/10-Interrupt_Priority_Set_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/11-Systick_Demo/Libraries/doc/version.txt b/Example/11-Systick_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/11-Systick_Demo/Libraries/doc/version.txt
+++ b/Example/11-Systick_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/11-Systick_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/12-Dual_Core_Demo/Libraries/doc/version.txt b/Example/12-Dual_Core_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/12-Dual_Core_Demo/Libraries/doc/version.txt
+++ b/Example/12-Dual_Core_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/12-Dual_Core_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/13-FFT_Demo/Libraries/doc/version.txt b/Example/13-FFT_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/13-FFT_Demo/Libraries/doc/version.txt
+++ b/Example/13-FFT_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/13-FFT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt
+++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/14-Specifies_Variable_Or_Code_Location_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/doc/version.txt b/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/doc/version.txt
+++ b/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/15-Cpu1_Handles_Interrupts_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/2-LED_Blink_Demo/Libraries/doc/version.txt b/Example/2-LED_Blink_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/2-LED_Blink_Demo/Libraries/doc/version.txt
+++ b/Example/2-LED_Blink_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/2-LED_Blink_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/3-PIT_Demo/Libraries/doc/version.txt b/Example/3-PIT_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/3-PIT_Demo/Libraries/doc/version.txt
+++ b/Example/3-PIT_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/3-PIT_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/4-Encoder_Demo/Libraries/doc/version.txt b/Example/4-Encoder_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/4-Encoder_Demo/Libraries/doc/version.txt
+++ b/Example/4-Encoder_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/4-Encoder_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/5-UART_Demo/Libraries/doc/version.txt b/Example/5-UART_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/5-UART_Demo/Libraries/doc/version.txt
+++ b/Example/5-UART_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/5-UART_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/6-Printf_Demo/Libraries/doc/version.txt b/Example/6-Printf_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/6-Printf_Demo/Libraries/doc/version.txt
+++ b/Example/6-Printf_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/6-Printf_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt b/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt
+++ b/Example/7-GPIO_Interrupt_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/7-GPIO_Interrupt_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/8-EEPROM_Demo/Libraries/doc/version.txt b/Example/8-EEPROM_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/8-EEPROM_Demo/Libraries/doc/version.txt
+++ b/Example/8-EEPROM_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/8-EEPROM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Example/8-EEPROM_Demo/USER/Cpu0_Main.c b/Example/8-EEPROM_Demo/USER/Cpu0_Main.c
index 578cb74..e7cf35d 100644
--- a/Example/8-EEPROM_Demo/USER/Cpu0_Main.c
+++ b/Example/8-EEPROM_Demo/USER/Cpu0_Main.c
@@ -48,10 +48,10 @@ int core0_main(void)
//检查当前页是否有数据,如果有数据则需要擦除整个扇区,
- if(flash_check(EXAMPLE_EEPROM_SECTOR, 0)) eeprom_erase_sector(EXAMPLE_EEPROM_SECTOR);
- if(flash_check(EXAMPLE_EEPROM_SECTOR, 1)) eeprom_erase_sector(EXAMPLE_EEPROM_SECTOR);
- if(flash_check(EXAMPLE_EEPROM_SECTOR, 2)) eeprom_erase_sector(EXAMPLE_EEPROM_SECTOR);
- if(flash_check(EXAMPLE_EEPROM_SECTOR, 3)) eeprom_erase_sector(EXAMPLE_EEPROM_SECTOR);
+ if(flash_check(EXAMPLE_EEPROM_SECTOR, 0) || flash_check(EXAMPLE_EEPROM_SECTOR, 1) || flash_check(EXAMPLE_EEPROM_SECTOR, 2) || flash_check(EXAMPLE_EEPROM_SECTOR, 3))
+ {
+ eeprom_erase_sector(EXAMPLE_EEPROM_SECTOR);
+ }
//当写入的数据不是32位时,建议将数据放入uint32 类型的变量中,在将该变量作为参数传入到eeprom_page_program函数
write_buf = write_data1;
diff --git a/Example/9-PWM_Demo/.cproject b/Example/9-PWM_Demo/.cproject
index 94479d9..ea8d05d 100644
--- a/Example/9-PWM_Demo/.cproject
+++ b/Example/9-PWM_Demo/.cproject
@@ -187,7 +187,11 @@
+ TASKING VX-toolset for TriCore: control program v6.3r1 Build 19041558
+ TASKING VX-toolset for TriCore: object linker v6.3r1 Build 19041558
+ TASKING VX-toolset for TriCore: assembler v6.3r1 Build 19041558
TASKING program builder v6.3r1 Build 19041558
+ TASKING VX-toolset for TriCore: C compiler v6.3r1 Build 19041558
diff --git a/Example/9-PWM_Demo/Libraries/doc/version.txt b/Example/9-PWM_Demo/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Example/9-PWM_Demo/Libraries/doc/version.txt
+++ b/Example/9-PWM_Demo/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Example/9-PWM_Demo/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/Seekfree_TC264_Opensource_Library/.cproject b/Seekfree_TC264_Opensource_Library/.cproject
index 311d388..80c5022 100644
--- a/Seekfree_TC264_Opensource_Library/.cproject
+++ b/Seekfree_TC264_Opensource_Library/.cproject
@@ -191,11 +191,7 @@
- TASKING VX-toolset for TriCore: control program v6.3r1 Build 19041558
- TASKING VX-toolset for TriCore: object linker v6.3r1 Build 19041558
- TASKING VX-toolset for TriCore: assembler v6.3r1 Build 19041558
TASKING program builder v6.3r1 Build 19041558
- TASKING VX-toolset for TriCore: C compiler v6.3r1 Build 19041558
diff --git a/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt b/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt
index 3dedfae..2684276 100644
--- a/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt
+++ b/Seekfree_TC264_Opensource_Library/Libraries/doc/version.txt
@@ -76,4 +76,7 @@ V1.1.0
V1.1.1
修复uart_getchar函数收到卡住的问题
+
+V1.1.2
+ 修复ATOM_PWM最大占空比设置异常的问题
\ No newline at end of file
diff --git a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gtm_pwm.c b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gtm_pwm.c
index 7b079c9..6f3abfb 100644
--- a/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gtm_pwm.c
+++ b/Seekfree_TC264_Opensource_Library/Libraries/seekfree_libraries/zf_gtm_pwm.c
@@ -280,7 +280,6 @@ void gtm_pwm_init(ATOM_PIN_enum pwmch, uint32 freq, uint32 duty)
g_atomConfig.pin.outputPin = atom_channel;
g_atomConfig.synchronousUpdateEnabled = TRUE;
- g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX);
switch(atom_channel->atom)
{
case 0: g_atomConfig.dutyCycle = (uint32)((uint64)duty * g_atomConfig.period / GTM_ATOM0_PWM_DUTY_MAX); break;
@@ -309,6 +308,13 @@ void pwm_duty(ATOM_PIN_enum pwmch, uint32 duty)
atom_channel = gtm_atom_mux(pwmch);
period = IfxGtm_Atom_Ch_getCompareZero(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel);
- duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX);
+
+ switch(atom_channel->atom)
+ {
+ case 0: duty = (uint32)((uint64)duty * period / GTM_ATOM0_PWM_DUTY_MAX); break;
+ case 1: duty = (uint32)((uint64)duty * period / GTM_ATOM1_PWM_DUTY_MAX); break;
+ case 2: duty = (uint32)((uint64)duty * period / GTM_ATOM2_PWM_DUTY_MAX); break;
+ case 3: duty = (uint32)((uint64)duty * period / GTM_ATOM3_PWM_DUTY_MAX); break;
+ }
IfxGtm_Atom_Ch_setCompareOneShadow(&MODULE_GTM.ATOM[atom_channel->atom], atom_channel->channel, duty);
}
diff --git a/銆愭枃妗c慣ASKING浣跨敤鏁欑▼ 鑺墖鎵嬪唽绛/閫愰绉戞妧 TASKING浣跨敤璇存槑涔.pdf b/銆愭枃妗c慣ASKING浣跨敤鏁欑▼ 鑺墖鎵嬪唽绛/閫愰绉戞妧 TASKING浣跨敤璇存槑涔.pdf
index 9d2cc04..21f1b20 100644
Binary files a/銆愭枃妗c慣ASKING浣跨敤鏁欑▼ 鑺墖鎵嬪唽绛/閫愰绉戞妧 TASKING浣跨敤璇存槑涔.pdf and b/銆愭枃妗c慣ASKING浣跨敤鏁欑▼ 鑺墖鎵嬪唽绛/閫愰绉戞妧 TASKING浣跨敤璇存槑涔.pdf differ