forked from acco/chti23
		
	Pwm wip
This commit is contained in:
		
							parent
							
								
									1f9ac64237
								
							
						
					
					
						commit
						0fc477a68d
					
				
					 4 changed files with 61 additions and 19 deletions
				
			
		|  | @ -2,13 +2,13 @@ | |||
| 	THUMB    | ||||
| 	 | ||||
| 	export CallbackSon | ||||
| 	 | ||||
| 	include DriverJeuLaser.inc | ||||
| 		 | ||||
| 
 | ||||
| ; ====================== zone de réservation de données,  ======================================
 | ||||
| ;Section RAM (read only) :
 | ||||
| 	area    mesdata,data,readonly | ||||
| 
 | ||||
| 	IMPORT LongueurSon | ||||
| 	IMPORT Son | ||||
| 		 | ||||
| ;Section RAM (read write):
 | ||||
|  | @ -30,18 +30,48 @@ SortieSon dcw 0; | |||
| 
 | ||||
| CallbackSon proc | ||||
| 	 | ||||
| 	ldr r0,=index | ||||
| 	ldr r1,[r0]; valeur index
 | ||||
| 	add r1,#1;
 | ||||
| 	str r1,[r0] ;mettre a jour index
 | ||||
| 	push{lr} | ||||
| 	 | ||||
| 	ldr r0,=LongueurSon | ||||
| 	ldr r1,=index ; @ index
 | ||||
| 	ldr r2,[r1] | ||||
| 	ldr r3,[r0] | ||||
| 	cmp r2,r3 | ||||
| 	beq ret | ||||
| 	 | ||||
| 	 | ||||
| 	ldr r0, =Son ; recuperer @ son
 | ||||
| 	ldrh r1, [r0];valeur son
 | ||||
| 	movs r2,r2,lsl #1 | ||||
| 	add r0,r2 | ||||
| 	ldrsh r2,[r0];valeur son
 | ||||
| 
 | ||||
| 	ldr r2, =SortieSon ;@ sortie son
 | ||||
| 	str r1,[r2]; mettre a jour SortieSon
 | ||||
| 	ldr r0, =SortieSon ;@ sortie son
 | ||||
| 	 | ||||
| 	;mise a l'echelle;
 | ||||
| 	add r2,#32768 | ||||
| 	mov r3,#719 | ||||
| 	mul r2,r3 | ||||
| 	mov r2,r2,asr #16 | ||||
| 	 | ||||
| 	; mettre a jour SortieSon
 | ||||
| 	str r2,[r0] | ||||
| 	 | ||||
| 	 | ||||
| 	push{r1} | ||||
| 	mov r0,r2 | ||||
| 	bl PWM_Set_Value_TIM3_Ch3 | ||||
| 	pop{r1} | ||||
| 	 | ||||
| 	;incrementer index
 | ||||
| 	ldr r0,[r1]; valeur index
 | ||||
| 	add r0,#1;
 | ||||
| 	str r0,[r1] ;mettre a jour index
 | ||||
| 	 | ||||
| 
 | ||||
| 	 | ||||
| 	 | ||||
| ret | ||||
| 	pop{pc} | ||||
| 	bx lr | ||||
| 
 | ||||
| 		 | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| 
 | ||||
| 
 | ||||
| #include "DriverJeuLaser.h" | ||||
| #include<math.h> | ||||
| 
 | ||||
| extern void CallbackSon(void); | ||||
| 
 | ||||
|  | @ -20,8 +19,8 @@ Timer_1234_Init_ff(TIM4,tick); | |||
| 	 | ||||
| Active_IT_Debordement_Timer( TIM4, 2, CallbackSon ); | ||||
| 
 | ||||
| 	 | ||||
| 	 | ||||
| PWM_Init_ff( TIM3, 3, 720); | ||||
| GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL); | ||||
| 
 | ||||
| //============================================================================	
 | ||||
| 	 | ||||
|  |  | |||
|  | @ -157,9 +157,9 @@ | |||
|         <Bp> | ||||
|           <Number>0</Number> | ||||
|           <Type>0</Type> | ||||
|           <LineNumber>33</LineNumber> | ||||
|           <LineNumber>57</LineNumber> | ||||
|           <EnabledFlag>1</EnabledFlag> | ||||
|           <Address>134220060</Address> | ||||
|           <Address>134220678</Address> | ||||
|           <ByteObject>0</ByteObject> | ||||
|           <HtxType>0</HtxType> | ||||
|           <ManyObjects>0</ManyObjects> | ||||
|  | @ -168,7 +168,7 @@ | |||
|           <BreakIfRCount>1</BreakIfRCount> | ||||
|           <Filename>.\Src\GestionSon.s</Filename> | ||||
|           <ExecCommand></ExecCommand> | ||||
|           <Expression>\\StepSon\Src/GestionSon.s\33</Expression> | ||||
|           <Expression>\\StepSon\Src/GestionSon.s\57</Expression> | ||||
|         </Bp> | ||||
|       </Breakpoint> | ||||
|       <WatchWindow1> | ||||
|  | @ -178,6 +178,14 @@ | |||
|           <ItemText>SortieSon</ItemText> | ||||
|         </Ww> | ||||
|       </WatchWindow1> | ||||
|       <MemoryWindow1> | ||||
|         <Mm> | ||||
|           <WinNumber>1</WinNumber> | ||||
|           <SubType>265</SubType> | ||||
|           <ItemText>R0</ItemText> | ||||
|           <AccSizeX>0</AccSizeX> | ||||
|         </Mm> | ||||
|       </MemoryWindow1> | ||||
|       <Tracepoint> | ||||
|         <THDelay>0</THDelay> | ||||
|       </Tracepoint> | ||||
|  | @ -223,8 +231,13 @@ | |||
|       <LogicAnalyzers> | ||||
|         <Wi> | ||||
|           <IntNumber>0</IntNumber> | ||||
|           <FirstString>((portb & 0x00000002) >> 1 & 0x2) >> 1</FirstString> | ||||
|           <SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F100000000000000000000000000000000000000096020008</SecondString> | ||||
|           <FirstString>`SortieSon</FirstString> | ||||
|           <SecondString>FF0000000000000000000000000000000050824000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F0C00000000000000000000000000000000000000E8080008</SecondString> | ||||
|         </Wi> | ||||
|         <Wi> | ||||
|           <IntNumber>1</IntNumber> | ||||
|           <FirstString>((portb & 0x00000001) & 0x1) >> 0</FirstString> | ||||
|           <SecondString>00800000000000000000000000000000E0FFEF400100000000000000000000000000000028706F72746220262030783030303030303031290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F0C00000000000000000000000000000000000000080B0008</SecondString> | ||||
|         </Wi> | ||||
|       </LogicAnalyzers> | ||||
|       <DebugDescription> | ||||
|  | @ -712,7 +725,7 @@ | |||
|       <GroupNumber>4</GroupNumber> | ||||
|       <FileNumber>5</FileNumber> | ||||
|       <FileType>2</FileType> | ||||
|       <tvExp>0</tvExp> | ||||
|       <tvExp>1</tvExp> | ||||
|       <tvExpOptDlg>0</tvExpOptDlg> | ||||
|       <bDave2>0</bDave2> | ||||
|       <PathWithFileName>.\Src\GestionSon.s</PathWithFileName> | ||||
|  |  | |||
|  | @ -357,7 +357,7 @@ | |||
|               <MiscControls></MiscControls> | ||||
|               <Define></Define> | ||||
|               <Undefine></Undefine> | ||||
|               <IncludePath></IncludePath> | ||||
|               <IncludePath>.\Driver</IncludePath> | ||||
|             </VariousControls> | ||||
|           </Aads> | ||||
|           <LDads> | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue