aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/Rendering/VisualLineTextParagraphProperties.cs
blob: c97cd6b6c00583dc3110fc0b3af1dbf5a9293b83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)

using System;
using System.Windows;
using System.Windows.Media.TextFormatting;

namespace ICSharpCode.AvalonEdit.Rendering
{
	sealed class VisualLineTextParagraphProperties : TextParagraphProperties
	{
		internal TextRunProperties defaultTextRunProperties;
		internal TextWrapping textWrapping;
		internal double tabSize;
		internal double indent;
		internal bool firstLineInParagraph;
		
		public override double DefaultIncrementalTab {
			get { return tabSize; }
		}
		
		public override FlowDirection FlowDirection { get { return FlowDirection.LeftToRight; } }
		public override TextAlignment TextAlignment { get { return TextAlignment.Left; } }
		public override double LineHeight { get { return double.NaN; } }
		public override bool FirstLineInParagraph { get { return firstLineInParagraph; } }
		public override TextRunProperties DefaultTextRunProperties { get { return defaultTextRunProperties; } }
		public override TextWrapping TextWrapping { get { return textWrapping; } }
		public override TextMarkerProperties TextMarkerProperties { get { return null; } }
		public override double Indent { get { return indent; } }
	}
}
> ui32Remaining; uint32_t ui32ProgAddr; uint32_t ui32BufferAddr; volatile uint32_t ui32Idx; uint32_t status = OK; //uint32_t ui32FlashEnd; #ifdef FLASH_DEBUG Address[RxIndex] = ui32FlashStart; Size[RxIndex] = ui32FileSize; EraseWrite[RxIndex] = READ; if (RxIndex++>=MAX_CONT_LOG) RxIndex = 0; #endif // // Get the size of flash. This is the ending address of the flash. // If reserved space is configured, then the ending address is reduced // by the amount of the reserved block. // //ui32FlashEnd = ui32FlashStart + ui32FileSize; // // Check to make sure the file size is not too large to fit in the flash. // If it is too large, then return an error. // /*if((ui32FileSize + ui32FlashStart) > ui32FlashEnd) { return(1); }*/ // // Enter a loop to erase all the requested flash pages beginning at the // application start address (above the USB stick updater). // /*for(ui32Idx = ui32FlashStart; ui32Idx < ui32FlashEnd; ui32Idx += 1024) { ROM_FlashErase(ui32Idx); }*/ // // Enter a loop to read sectors from the application image file and // program into flash. Start at the user app start address (above the USB // stick updater). // ui32ProgAddr = ui32FlashStart; ui32BufferAddr = (uint32_t)buffer; ui32Remaining = ui32FileSize; while(ui32Remaining) { // // Compute how much data was read from this sector and adjust the // remaining amount. // ui32DataSize = ui32Remaining >= 512 ? 512 : ui32Remaining; ui32Remaining -= ui32DataSize; // // Call the function to program a block of flash. The length of the // block passed to the flash function must be divisible by 4. // ROM_IntMasterDisable(); status = ROM_FlashProgram((uint32_t *)ui32BufferAddr, ui32ProgAddr,(ui32DataSize + 3) & ~3); ROM_IntMasterEnable(); if (status) Report("FlashProgram Error", __FILE__,status,ui32ProgAddr , RpMessage, (ui32DataSize + 3) & ~3, 0); // // If there is more image to program, then update the programming // address. Progress will continue to the next iteration of // the while loop. // if(ui32Remaining) { ui32ProgAddr += ui32DataSize; ui32BufferAddr += ui32DataSize; } } // // If we make it here, that means that an attempt to read a sector of // data from the device was not successful. That means that the complete // user app has not been programmed into flash, so just return an error // indication. // return(1); } uint32_t EraseFlashSection(uint32_t ui32FlashStart) { volatile uint32_t ui32Idx = ui32FlashStart; uint32_t status; #ifdef FLASH_DEBUG Address[RxIndex] = ui32FlashStart; Size[RxIndex] = ui32FileSize; EraseWrite[RxIndex] = DELETE; if (RxIndex++>=MAX_CONT_LOG) RxIndex = 0; #endif status = FlashErase(ui32Idx); return status; } //Each word may not be subject to more than a specific number of programming cycles before an //erase cycle is required. In other words, for any given word, FlashProgram can only be called //twice before FlashErase is called. void FlashInit(void) { volatile uint32_t ui32Idx; //FlashUsecSet(120); #ifdef FLASH_DEBUG Address[RxIndex] = FLASH_RAM_BASE; Size[RxIndex] = FLASH_SIZE; EraseWrite[RxIndex] = DELETE; if (RxIndex++>=MAX_CONT_LOG) RxIndex = 0; #endif ROM_IntMasterDisable(); for(ui32Idx = FLASH_RAM_BASE; ui32Idx < FLASH_RAM_BASE+FLASH_SIZE; ui32Idx += 1024) { ROM_FlashErase(ui32Idx); } ROM_IntMasterEnable(); }