Skip to content

Commit

Permalink
Add support for more program widths (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
TerryFogg authored Jan 4, 2023
1 parent 14ac1cd commit e7fad37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ public static DeploymentSector ToDeploymentSector(this FlashSectorData value)
programmingAlignment = 256 / 8;
break;

case BlockRegionAttribute_ProgramWidthIs512bits:
programmingAlignment = 512 / 8;
break;

case BlockRegionAttribute_ProgramWidthIs1024bits:
programmingAlignment = 1024 / 8;
break;

case BlockRegionAttribute_ProgramWidthIs2048bits:
programmingAlignment = 2048 / 8;
break;

default:
throw new NotSupportedException($"The specified Flash Program Width '{blockRegionFlashProgrammingWidth}' is not supported. Please check the native implementation and/or that you have the .NET nanoFramework Visual Studio extension update.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class Monitor_FlashSectorMap

// media attributes
public const uint BlockRegionAttributes_MASK = 0x0000FF00;
public const uint BlockRegionFlashProgrammingWidth_MASK = 0x00000E00;
public const uint BlockRegionFlashProgrammingWidth_MASK = 0x00007E00;

public const uint BlockRegionAttribute_MemoryMapped = 0x0100;

Expand All @@ -105,6 +105,9 @@ public class Monitor_FlashSectorMap
public const uint BlockRegionAttribute_ProgramWidthIs64bits = 0x0200;
public const uint BlockRegionAttribute_ProgramWidthIs128bits = 0x0400;
public const uint BlockRegionAttribute_ProgramWidthIs256bits = 0x0800;
public const uint BlockRegionAttribute_ProgramWidthIs512bits = 0x1000;
public const uint BlockRegionAttribute_ProgramWidthIs1024bits = 0x2000;
public const uint BlockRegionAttribute_ProgramWidthIs2048bits = 0x4000;

public struct FlashSectorData
{
Expand Down

0 comments on commit e7fad37

Please sign in to comment.