Fin TP 3
This commit is contained in:
		
							parent
							
								
									15cdcee56f
								
							
						
					
					
						commit
						f597e293ff
					
				
					 5 changed files with 140 additions and 19 deletions
				
			
		
							
								
								
									
										17
									
								
								Brouillon.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Brouillon.txt
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | ||||||
|  | int[] tableau = les valeurs; | ||||||
|  | int SortieSon; | ||||||
|  | int index = 0; | ||||||
|  | 
 | ||||||
|  | int CallbackSon() | ||||||
|  | { | ||||||
|  | 	echantillon = tableau[index]; | ||||||
|  | 	SortieSon = (int)(echantillon * 360 / 32768) + 360; | ||||||
|  | 	return SortieSon | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | while (index<5512) | ||||||
|  | { | ||||||
|  | 	CallbackSon(); | ||||||
|  | 	index++; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @ -11,9 +11,13 @@ | ||||||
| 	area    maram,data,readwrite | 	area    maram,data,readwrite | ||||||
| 		 | 		 | ||||||
| 
 | 
 | ||||||
| 	 | SortieSon dcw 0 | ||||||
|  | Index dcd 0x00000000 | ||||||
| ; ===============================================================================================
 | ; ===============================================================================================
 | ||||||
| 	 | 		EXPORT CallbackSon | ||||||
|  | 		EXPORT SortieSon | ||||||
|  | 		EXTERN Son | ||||||
|  | 		EXTERN LongueurSon | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 		 | 		 | ||||||
|  | @ -21,10 +25,32 @@ | ||||||
| 	area    moncode,code,readonly | 	area    moncode,code,readonly | ||||||
| ; écrire le code ici		
 | ; écrire le code ici		
 | ||||||
| 
 | 
 | ||||||
| 
 | CallbackSon proc | ||||||
| 
 | 	push {lr} | ||||||
| 
 | 	ldr r0, =SortieSon | ||||||
| 
 | 	ldr r1, =Son | ||||||
| 		 | 	ldr r2, =Index | ||||||
|  | 	ldr r3, =LongueurSon | ||||||
|  | 	push {r4} | ||||||
|  | 	push {r5} | ||||||
|  | 	push {r6} | ||||||
|  | 	push {r7} | ||||||
|  | 	push {r8} | ||||||
|  | 	ldr r4, [r2]   ;on stocke la valeur de l'index dans r2.
 | ||||||
|  | 	ldr r5, [r1, r4]  ;on stocke la valeur de Son[index] dans r5;
 | ||||||
|  | 	ldr r6, [r0] ; on stocke la valeur de SortieSon dans r6
 | ||||||
|  | 	mov r7, #360 | ||||||
|  | 	mov r8, #32768 | ||||||
|  | 	mul r5, r7 | ||||||
|  | 	sdiv r5, r8 | ||||||
|  | 	adds r5, #360 | ||||||
|  | 	str r5, [r0] ; on stocke la valeur calculee dans r0
 | ||||||
|  | 	adds r4, #1; on incremente r4 qui correspond à la valeur de l'index
 | ||||||
|  | 	ldr r2, [r4]; on stocke la nouvelle valeur de l'index à l'adresse de l'index
 | ||||||
|  | 	pop {r6} | ||||||
|  | 	pop {r5} | ||||||
|  | 	pop {r4} | ||||||
|  | 	pop {pc} | ||||||
|  | 	ENDFUNC | ||||||
| 	 | 	 | ||||||
| 	END	 | 	END	 | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| #include "DriverJeuLaser.h" | #include "DriverJeuLaser.h" | ||||||
| 
 | extern int CallbackSon(); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| int main(void) | int main(void) | ||||||
|  | @ -13,6 +13,12 @@ int main(void) | ||||||
| 
 | 
 | ||||||
| // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
 | // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
 | ||||||
| CLOCK_Configure(); | CLOCK_Configure(); | ||||||
|  | // configuration du Timer 4 en débordement 100ms
 | ||||||
|  | u32 duree = 655200; //91*7200
 | ||||||
|  | Timer_1234_Init_ff(TIM4, duree); | ||||||
|  | 
 | ||||||
|  | //** Placez votre code là ** // 	
 | ||||||
|  | Active_IT_Debordement_Timer(TIM4, 2, CallbackSon); 		 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	 | 	 | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|     <aExt>*.s*; *.src; *.a*</aExt> |     <aExt>*.s*; *.src; *.a*</aExt> | ||||||
|     <oExt>*.obj; *.o</oExt> |     <oExt>*.obj; *.o</oExt> | ||||||
|     <lExt>*.lib</lExt> |     <lExt>*.lib</lExt> | ||||||
|     <tExt>*.txt; *.h; *.inc</tExt> |     <tExt>*.txt; *.h; *.inc; *.md</tExt> | ||||||
|     <pExt>*.plm</pExt> |     <pExt>*.plm</pExt> | ||||||
|     <CppX>*.cpp</CppX> |     <CppX>*.cpp</CppX> | ||||||
|     <nMigrate>0</nMigrate> |     <nMigrate>0</nMigrate> | ||||||
|  | @ -75,7 +75,7 @@ | ||||||
|       <OPTFL> |       <OPTFL> | ||||||
|         <tvExp>1</tvExp> |         <tvExp>1</tvExp> | ||||||
|         <tvExpOptDlg>0</tvExpOptDlg> |         <tvExpOptDlg>0</tvExpOptDlg> | ||||||
|         <IsCurrentTarget>0</IsCurrentTarget> |         <IsCurrentTarget>1</IsCurrentTarget> | ||||||
|       </OPTFL> |       </OPTFL> | ||||||
|       <CpuCode>18</CpuCode> |       <CpuCode>18</CpuCode> | ||||||
|       <DebugOpt> |       <DebugOpt> | ||||||
|  | @ -460,7 +460,7 @@ | ||||||
|       <OPTFL> |       <OPTFL> | ||||||
|         <tvExp>1</tvExp> |         <tvExp>1</tvExp> | ||||||
|         <tvExpOptDlg>0</tvExpOptDlg> |         <tvExpOptDlg>0</tvExpOptDlg> | ||||||
|         <IsCurrentTarget>1</IsCurrentTarget> |         <IsCurrentTarget>0</IsCurrentTarget> | ||||||
|       </OPTFL> |       </OPTFL> | ||||||
|       <CpuCode>18</CpuCode> |       <CpuCode>18</CpuCode> | ||||||
|       <DebugOpt> |       <DebugOpt> | ||||||
|  | @ -666,6 +666,38 @@ | ||||||
|     </File> |     </File> | ||||||
|   </Group> |   </Group> | ||||||
| 
 | 
 | ||||||
|  |   <Group> | ||||||
|  |     <GroupName>Son</GroupName> | ||||||
|  |     <tvExp>1</tvExp> | ||||||
|  |     <tvExpOptDlg>0</tvExpOptDlg> | ||||||
|  |     <cbSel>0</cbSel> | ||||||
|  |     <RteFlg>0</RteFlg> | ||||||
|  |     <File> | ||||||
|  |       <GroupNumber>4</GroupNumber> | ||||||
|  |       <FileNumber>4</FileNumber> | ||||||
|  |       <FileType>2</FileType> | ||||||
|  |       <tvExp>0</tvExp> | ||||||
|  |       <tvExpOptDlg>0</tvExpOptDlg> | ||||||
|  |       <bDave2>0</bDave2> | ||||||
|  |       <PathWithFileName>.\Src\GestionSon.s</PathWithFileName> | ||||||
|  |       <FilenameWithoutPath>GestionSon.s</FilenameWithoutPath> | ||||||
|  |       <RteFlg>0</RteFlg> | ||||||
|  |       <bShared>0</bShared> | ||||||
|  |     </File> | ||||||
|  |     <File> | ||||||
|  |       <GroupNumber>4</GroupNumber> | ||||||
|  |       <FileNumber>5</FileNumber> | ||||||
|  |       <FileType>2</FileType> | ||||||
|  |       <tvExp>0</tvExp> | ||||||
|  |       <tvExpOptDlg>0</tvExpOptDlg> | ||||||
|  |       <bDave2>0</bDave2> | ||||||
|  |       <PathWithFileName>.\Src\bruitverre.asm</PathWithFileName> | ||||||
|  |       <FilenameWithoutPath>bruitverre.asm</FilenameWithoutPath> | ||||||
|  |       <RteFlg>0</RteFlg> | ||||||
|  |       <bShared>0</bShared> | ||||||
|  |     </File> | ||||||
|  |   </Group> | ||||||
|  | 
 | ||||||
|   <Group> |   <Group> | ||||||
|     <GroupName>::CMSIS</GroupName> |     <GroupName>::CMSIS</GroupName> | ||||||
|     <tvExp>0</tvExp> |     <tvExp>0</tvExp> | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|       <TargetName>Simu</TargetName> |       <TargetName>Simu</TargetName> | ||||||
|       <ToolsetNumber>0x4</ToolsetNumber> |       <ToolsetNumber>0x4</ToolsetNumber> | ||||||
|       <ToolsetName>ARM-ADS</ToolsetName> |       <ToolsetName>ARM-ADS</ToolsetName> | ||||||
|       <pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed> |       <pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed> | ||||||
|       <uAC6>0</uAC6> |       <uAC6>0</uAC6> | ||||||
|       <TargetOption> |       <TargetOption> | ||||||
|         <TargetCommonOption> |         <TargetCommonOption> | ||||||
|  | @ -410,6 +410,21 @@ | ||||||
|             </File> |             </File> | ||||||
|           </Files> |           </Files> | ||||||
|         </Group> |         </Group> | ||||||
|  |         <Group> | ||||||
|  |           <GroupName>Son</GroupName> | ||||||
|  |           <Files> | ||||||
|  |             <File> | ||||||
|  |               <FileName>GestionSon.s</FileName> | ||||||
|  |               <FileType>2</FileType> | ||||||
|  |               <FilePath>.\Src\GestionSon.s</FilePath> | ||||||
|  |             </File> | ||||||
|  |             <File> | ||||||
|  |               <FileName>bruitverre.asm</FileName> | ||||||
|  |               <FileType>2</FileType> | ||||||
|  |               <FilePath>.\Src\bruitverre.asm</FilePath> | ||||||
|  |             </File> | ||||||
|  |           </Files> | ||||||
|  |         </Group> | ||||||
|         <Group> |         <Group> | ||||||
|           <GroupName>::CMSIS</GroupName> |           <GroupName>::CMSIS</GroupName> | ||||||
|         </Group> |         </Group> | ||||||
|  | @ -819,6 +834,21 @@ | ||||||
|             </File> |             </File> | ||||||
|           </Files> |           </Files> | ||||||
|         </Group> |         </Group> | ||||||
|  |         <Group> | ||||||
|  |           <GroupName>Son</GroupName> | ||||||
|  |           <Files> | ||||||
|  |             <File> | ||||||
|  |               <FileName>GestionSon.s</FileName> | ||||||
|  |               <FileType>2</FileType> | ||||||
|  |               <FilePath>.\Src\GestionSon.s</FilePath> | ||||||
|  |             </File> | ||||||
|  |             <File> | ||||||
|  |               <FileName>bruitverre.asm</FileName> | ||||||
|  |               <FileType>2</FileType> | ||||||
|  |               <FilePath>.\Src\bruitverre.asm</FilePath> | ||||||
|  |             </File> | ||||||
|  |           </Files> | ||||||
|  |         </Group> | ||||||
|         <Group> |         <Group> | ||||||
|           <GroupName>::CMSIS</GroupName> |           <GroupName>::CMSIS</GroupName> | ||||||
|           <GroupOption> |           <GroupOption> | ||||||
|  | @ -1297,6 +1327,21 @@ | ||||||
|             </File> |             </File> | ||||||
|           </Files> |           </Files> | ||||||
|         </Group> |         </Group> | ||||||
|  |         <Group> | ||||||
|  |           <GroupName>Son</GroupName> | ||||||
|  |           <Files> | ||||||
|  |             <File> | ||||||
|  |               <FileName>GestionSon.s</FileName> | ||||||
|  |               <FileType>2</FileType> | ||||||
|  |               <FilePath>.\Src\GestionSon.s</FilePath> | ||||||
|  |             </File> | ||||||
|  |             <File> | ||||||
|  |               <FileName>bruitverre.asm</FileName> | ||||||
|  |               <FileType>2</FileType> | ||||||
|  |               <FilePath>.\Src\bruitverre.asm</FilePath> | ||||||
|  |             </File> | ||||||
|  |           </Files> | ||||||
|  |         </Group> | ||||||
|         <Group> |         <Group> | ||||||
|           <GroupName>::CMSIS</GroupName> |           <GroupName>::CMSIS</GroupName> | ||||||
|         </Group> |         </Group> | ||||||
|  | @ -1322,12 +1367,7 @@ | ||||||
|   <LayerInfo> |   <LayerInfo> | ||||||
|     <Layers> |     <Layers> | ||||||
|       <Layer> |       <Layer> | ||||||
|         <LayName><Project Info></LayName> |         <LayName>StepSon</LayName> | ||||||
|         <LayDesc></LayDesc> |  | ||||||
|         <LayUrl></LayUrl> |  | ||||||
|         <LayKeys></LayKeys> |  | ||||||
|         <LayCat></LayCat> |  | ||||||
|         <LayLic></LayLic> |  | ||||||
|         <LayTarg>0</LayTarg> |         <LayTarg>0</LayTarg> | ||||||
|         <LayPrjMark>1</LayPrjMark> |         <LayPrjMark>1</LayPrjMark> | ||||||
|       </Layer> |       </Layer> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue